diff --git a/.golangci.yml b/.golangci.yml index e7d9ce99..28e1365d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -81,7 +81,7 @@ linters-settings: sections: - standard # Standard section: captures all standard packages. - default # Default section: contains all imports that could not be matched to another section type. - - prefix(github.com/s-things) # Custom section: groups all imports with the specified Prefix. + - prefix(github.com/gammazero) # Custom section: groups all imports with the specified Prefix. # Skip generated files. # Default: true #skip-generated: false diff --git a/aat/auth_test.go b/aat/auth_test.go index 5f56ecca..70738ab3 100644 --- a/aat/auth_test.go +++ b/aat/auth_test.go @@ -11,11 +11,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/pbkdf2" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" "github.com/gammazero/nexus/v3/wamp/crsign" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/pbkdf2" ) const ( diff --git a/aat/main_test.go b/aat/main_test.go index e5c2d372..af454934 100644 --- a/aat/main_test.go +++ b/aat/main_test.go @@ -14,14 +14,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "go.uber.org/goleak" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/router" "github.com/gammazero/nexus/v3/router/auth" "github.com/gammazero/nexus/v3/stdlog" "github.com/gammazero/nexus/v3/transport/serialize" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" - "go.uber.org/goleak" ) const ( diff --git a/aat/pubsub_test.go b/aat/pubsub_test.go index e7d1490c..9c288248 100644 --- a/aat/pubsub_test.go +++ b/aat/pubsub_test.go @@ -6,8 +6,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) const ( diff --git a/aat/registration_meta_test.go b/aat/registration_meta_test.go index eefa2939..5ddaae55 100644 --- a/aat/registration_meta_test.go +++ b/aat/registration_meta_test.go @@ -7,9 +7,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const ( diff --git a/aat/rpc_progress_test.go b/aat/rpc_progress_test.go index d0d28322..ff8b892a 100644 --- a/aat/rpc_progress_test.go +++ b/aat/rpc_progress_test.go @@ -6,9 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const ( diff --git a/aat/rpc_shared_test.go b/aat/rpc_shared_test.go index c9435821..d0ec5904 100644 --- a/aat/rpc_shared_test.go +++ b/aat/rpc_shared_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) func TestRPCSharedRoundRobin(t *testing.T) { diff --git a/aat/rpc_test.go b/aat/rpc_test.go index a65a9ac2..5e87d84d 100644 --- a/aat/rpc_test.go +++ b/aat/rpc_test.go @@ -6,9 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) func TestRPCRegisterAndCall(t *testing.T) { diff --git a/aat/session_meta_kill_test.go b/aat/session_meta_kill_test.go index 4f5ff0a4..f3d75668 100644 --- a/aat/session_meta_kill_test.go +++ b/aat/session_meta_kill_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const ( diff --git a/aat/session_meta_test.go b/aat/session_meta_test.go index e101ece6..dbbf8b19 100644 --- a/aat/session_meta_test.go +++ b/aat/session_meta_test.go @@ -6,9 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const ( diff --git a/aat/session_testament_meta_test.go b/aat/session_testament_meta_test.go index 3324dc1a..59005918 100644 --- a/aat/session_testament_meta_test.go +++ b/aat/session_testament_meta_test.go @@ -6,8 +6,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) const ( diff --git a/aat/sessionfilter_test.go b/aat/sessionfilter_test.go index d4e3c78f..c663a574 100644 --- a/aat/sessionfilter_test.go +++ b/aat/sessionfilter_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) func TestWhitelistAttribute(t *testing.T) { diff --git a/aat/subscription_meta_test.go b/aat/subscription_meta_test.go index 1e558669..972a7d29 100644 --- a/aat/subscription_meta_test.go +++ b/aat/subscription_meta_test.go @@ -7,9 +7,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/client" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const ( diff --git a/client/client_test.go b/client/client_test.go index c09ac93a..02eaf617 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -12,13 +12,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "go.uber.org/goleak" + "github.com/gammazero/nexus/v3/router" "github.com/gammazero/nexus/v3/router/auth" "github.com/gammazero/nexus/v3/stdlog" "github.com/gammazero/nexus/v3/wamp" "github.com/gammazero/nexus/v3/wamp/crsign" - "github.com/stretchr/testify/require" - "go.uber.org/goleak" ) const ( diff --git a/router/auth/anonymous_test.go b/router/auth/anonymous_test.go index 6502b3fe..0027f301 100644 --- a/router/auth/anonymous_test.go +++ b/router/auth/anonymous_test.go @@ -3,9 +3,10 @@ package auth_test import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/router/auth" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) func TestAnonAuth(t *testing.T) { diff --git a/router/auth/crauth_test.go b/router/auth/crauth_test.go index e55be40c..d3afbd24 100644 --- a/router/auth/crauth_test.go +++ b/router/auth/crauth_test.go @@ -6,11 +6,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/router/auth" "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/wamp" "github.com/gammazero/nexus/v3/wamp/crsign" - "github.com/stretchr/testify/require" ) type testKeyStore struct { diff --git a/router/auth/cryptosign.go b/router/auth/cryptosign.go index 6460100d..ca18a3f7 100644 --- a/router/auth/cryptosign.go +++ b/router/auth/cryptosign.go @@ -7,8 +7,9 @@ import ( "fmt" "time" - "github.com/gammazero/nexus/v3/wamp" "golang.org/x/crypto/nacl/sign" + + "github.com/gammazero/nexus/v3/wamp" ) type CryptoSignAuthenticator struct { diff --git a/router/authorizer_test.go b/router/authorizer_test.go index d91f5512..e7845b94 100644 --- a/router/authorizer_test.go +++ b/router/authorizer_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) const ( diff --git a/router/broker_test.go b/router/broker_test.go index 50b696ef..58c28d2f 100644 --- a/router/broker_test.go +++ b/router/broker_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) type testPeer struct { diff --git a/router/dealer_test.go b/router/dealer_test.go index 36c1c243..ac8a45ac 100644 --- a/router/dealer_test.go +++ b/router/dealer_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) func newTestDealer(t *testing.T) (*dealer, wamp.Peer) { diff --git a/router/publishfilter_test.go b/router/publishfilter_test.go index 3bed50e1..3aa8c38d 100644 --- a/router/publishfilter_test.go +++ b/router/publishfilter_test.go @@ -3,8 +3,9 @@ package router import ( "testing" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) func TestFilterBlacklist(t *testing.T) { diff --git a/router/rawsocketserver_test.go b/router/rawsocketserver_test.go index 380f02f3..007613ad 100644 --- a/router/rawsocketserver_test.go +++ b/router/rawsocketserver_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/transport/serialize" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" ) const tcpAddr = "127.0.0.1:8181" diff --git a/router/router_test.go b/router/router_test.go index 87f3c3df..c04f6873 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -6,11 +6,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "go.uber.org/goleak" + "github.com/gammazero/nexus/v3/stdlog" "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/wamp" - "github.com/stretchr/testify/require" - "go.uber.org/goleak" ) const ( diff --git a/router/sessionkill_test.go b/router/sessionkill_test.go index 765f5c49..7cd4651c 100644 --- a/router/sessionkill_test.go +++ b/router/sessionkill_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) func TestSessionKill(t *testing.T) { diff --git a/router/testaments_test.go b/router/testaments_test.go index b3a9fd3e..1afea371 100644 --- a/router/testaments_test.go +++ b/router/testaments_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) func TestSessionTestaments(t *testing.T) { diff --git a/router/websocketserver.go b/router/websocketserver.go index 1dca7f3d..d184c453 100644 --- a/router/websocketserver.go +++ b/router/websocketserver.go @@ -14,10 +14,11 @@ import ( "strings" "time" + "github.com/gorilla/websocket" + "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/transport/serialize" "github.com/gammazero/nexus/v3/wamp" - "github.com/gorilla/websocket" ) const ( diff --git a/router/websocketserver_test.go b/router/websocketserver_test.go index 7cf2d20d..9788c72e 100644 --- a/router/websocketserver_test.go +++ b/router/websocketserver_test.go @@ -6,11 +6,12 @@ import ( "net/http" "testing" + "github.com/gorilla/websocket" + "github.com/stretchr/testify/require" + "github.com/gammazero/nexus/v3/transport" "github.com/gammazero/nexus/v3/transport/serialize" "github.com/gammazero/nexus/v3/wamp" - "github.com/gorilla/websocket" - "github.com/stretchr/testify/require" ) var ( diff --git a/transport/localpeer_test.go b/transport/localpeer_test.go index 9623a364..84e72b35 100644 --- a/transport/localpeer_test.go +++ b/transport/localpeer_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) func TestSendRecv(t *testing.T) { diff --git a/transport/serialize/cborserializer.go b/transport/serialize/cborserializer.go index 4d26b506..3d0e6864 100644 --- a/transport/serialize/cborserializer.go +++ b/transport/serialize/cborserializer.go @@ -4,8 +4,9 @@ import ( "errors" "reflect" - "github.com/gammazero/nexus/v3/wamp" "github.com/ugorji/go/codec" + + "github.com/gammazero/nexus/v3/wamp" ) var ch *codec.CborHandle diff --git a/transport/serialize/jsonserializer.go b/transport/serialize/jsonserializer.go index 08a553cd..e5ab8138 100644 --- a/transport/serialize/jsonserializer.go +++ b/transport/serialize/jsonserializer.go @@ -5,8 +5,9 @@ import ( "errors" "reflect" - "github.com/gammazero/nexus/v3/wamp" "github.com/ugorji/go/codec" + + "github.com/gammazero/nexus/v3/wamp" ) var jh *codec.JsonHandle diff --git a/transport/serialize/msgpackserializer.go b/transport/serialize/msgpackserializer.go index 3efd9e47..1cdfd89d 100644 --- a/transport/serialize/msgpackserializer.go +++ b/transport/serialize/msgpackserializer.go @@ -4,8 +4,9 @@ import ( "errors" "reflect" - "github.com/gammazero/nexus/v3/wamp" "github.com/ugorji/go/codec" + + "github.com/gammazero/nexus/v3/wamp" ) var mh *codec.MsgpackHandle diff --git a/transport/serialize/serializer_test.go b/transport/serialize/serializer_test.go index d183bd2b..0cc74d4f 100644 --- a/transport/serialize/serializer_test.go +++ b/transport/serialize/serializer_test.go @@ -7,8 +7,9 @@ import ( "reflect" "testing" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" + + "github.com/gammazero/nexus/v3/wamp" ) var dataItem = []map[string]interface{}{{ diff --git a/transport/websocketpeer.go b/transport/websocketpeer.go index 04ca1374..1ae839cf 100644 --- a/transport/websocketpeer.go +++ b/transport/websocketpeer.go @@ -10,10 +10,11 @@ import ( "sync/atomic" "time" + "github.com/gorilla/websocket" + "github.com/gammazero/nexus/v3/stdlog" "github.com/gammazero/nexus/v3/transport/serialize" "github.com/gammazero/nexus/v3/wamp" - "github.com/gorilla/websocket" ) // DialFunc is an alternate Dial function for the websocket dialer. diff --git a/wamp/crsign/crsign.go b/wamp/crsign/crsign.go index ab820767..f8bbf053 100644 --- a/wamp/crsign/crsign.go +++ b/wamp/crsign/crsign.go @@ -8,8 +8,9 @@ import ( "encoding/base64" "hash" - "github.com/gammazero/nexus/v3/wamp" "golang.org/x/crypto/pbkdf2" + + "github.com/gammazero/nexus/v3/wamp" ) // SignChallenge computes the HMAC-SHA256, using the given key, over the diff --git a/wamp/crsign/crsign_test.go b/wamp/crsign/crsign_test.go index 3e25752f..07fca826 100644 --- a/wamp/crsign/crsign_test.go +++ b/wamp/crsign/crsign_test.go @@ -5,9 +5,10 @@ import ( "encoding/base64" "testing" - "github.com/gammazero/nexus/v3/wamp" "github.com/stretchr/testify/require" "golang.org/x/crypto/pbkdf2" + + "github.com/gammazero/nexus/v3/wamp" ) var chStr = "{ \"nonce\":\"LHRTC9zeOIrt_9U3\", \"authprovider\":\"userdb\", \"authid\":\"peter\", " +