From 7a789fed371ae3f3ded30d47f5e7eee5522051a1 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 4 Oct 2020 06:29:21 +0800 Subject: [PATCH 1/2] Run go fmt --- proxy/shadowsocks/config.go | 8 ++++---- proxy/shadowsocks/protocol.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/shadowsocks/config.go b/proxy/shadowsocks/config.go index 45452cd6..0b59d391 100644 --- a/proxy/shadowsocks/config.go +++ b/proxy/shadowsocks/config.go @@ -19,8 +19,8 @@ import ( // MemoryAccount is an account type converted from Account. type MemoryAccount struct { - Cipher Cipher - Key []byte + Cipher Cipher + Key []byte } // Equals implements protocol.Account.Equals(). @@ -87,8 +87,8 @@ func (a *Account) AsAccount() (protocol.Account, error) { return nil, newError("failed to get cipher").Base(err) } return &MemoryAccount{ - Cipher: cipher, - Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), + Cipher: cipher, + Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), }, nil } diff --git a/proxy/shadowsocks/protocol.go b/proxy/shadowsocks/protocol.go index d8f6813e..4d4fc414 100644 --- a/proxy/shadowsocks/protocol.go +++ b/proxy/shadowsocks/protocol.go @@ -19,7 +19,7 @@ import ( ) const ( - Version = 1 + Version = 1 ) var addrParser = protocol.NewAddressParser( From f184d169184548fdabe7dcedef518d591a551d04 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 4 Oct 2020 06:29:35 +0800 Subject: [PATCH 2/2] Fix golangci nolint --- app/router/command/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/router/command/command.go b/app/router/command/command.go index 378bb7f7..2a6867fe 100644 --- a/app/router/command/command.go +++ b/app/router/command/command.go @@ -39,7 +39,7 @@ func (s *routingServer) TestRoute(ctx context.Context, request *TestRouteRequest return nil, err } if request.PublishResult && s.routingStats != nil { - ctx, _ := context.WithTimeout(context.Background(), 4*time.Second) // nolint: lostcancel + ctx, _ := context.WithTimeout(context.Background(), 4*time.Second) // nolint: govet s.routingStats.Publish(ctx, route) } return AsProtobufMessage(request.FieldSelectors)(route), nil