From 9b43da0b171817198c3bafff83e82446efbfb313 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 8 Feb 2024 16:35:35 -0300 Subject: [PATCH] use stdlib "slices". --- examples/basic-elasticsearch/main.go | 2 +- examples/basic-postgres/main.go | 2 +- examples/basic-sqlite3/main.go | 2 +- go.mod | 2 +- policies/events.go | 3 ++- policies/filters.go | 3 ++- policies/nip04.go | 3 ++- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/basic-elasticsearch/main.go b/examples/basic-elasticsearch/main.go index 8c6cfd2..30b17e8 100644 --- a/examples/basic-elasticsearch/main.go +++ b/examples/basic-elasticsearch/main.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/fiatjaf/khatru" "github.com/fiatjaf/eventstore/elasticsearch" + "github.com/fiatjaf/khatru" ) func main() { diff --git a/examples/basic-postgres/main.go b/examples/basic-postgres/main.go index 4ee891c..c9aa284 100644 --- a/examples/basic-postgres/main.go +++ b/examples/basic-postgres/main.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/fiatjaf/khatru" "github.com/fiatjaf/eventstore/postgresql" + "github.com/fiatjaf/khatru" ) func main() { diff --git a/examples/basic-sqlite3/main.go b/examples/basic-sqlite3/main.go index cec707a..f92887a 100644 --- a/examples/basic-sqlite3/main.go +++ b/examples/basic-sqlite3/main.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/fiatjaf/khatru" "github.com/fiatjaf/eventstore/sqlite3" + "github.com/fiatjaf/khatru" ) func main() { diff --git a/go.mod b/go.mod index b15d032..2266056 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/puzpuzpuz/xsync/v3 v3.0.2 github.com/rs/cors v1.7.0 github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a - golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( @@ -51,6 +50,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect go.opencensus.io v0.24.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/policies/events.go b/policies/events.go index 3bcb32e..f589572 100644 --- a/policies/events.go +++ b/policies/events.go @@ -3,8 +3,9 @@ package policies import ( "context" + "slices" + "github.com/nbd-wtf/go-nostr" - "golang.org/x/exp/slices" ) // PreventTooManyIndexableTags returns a function that can be used as a RejectFilter that will reject diff --git a/policies/filters.go b/policies/filters.go index e037f8a..238445b 100644 --- a/policies/filters.go +++ b/policies/filters.go @@ -3,8 +3,9 @@ package policies import ( "context" + "slices" + "github.com/nbd-wtf/go-nostr" - "golang.org/x/exp/slices" ) // NoComplexFilters disallows filters with more than 2 tags. diff --git a/policies/nip04.go b/policies/nip04.go index 92d71ca..087746d 100644 --- a/policies/nip04.go +++ b/policies/nip04.go @@ -3,9 +3,10 @@ package policies import ( "context" + "slices" + "github.com/fiatjaf/khatru" "github.com/nbd-wtf/go-nostr" - "golang.org/x/exp/slices" ) // RejectKind04Snoopers prevents reading NIP-04 messages from people not involved in the conversation.