Browse Source

Merge pull request #258 from Loyalsoldier/refine-codes

Refine codes
Loyalsoldier 5 years ago
parent
commit
68dd2a0d85
3 changed files with 6 additions and 6 deletions
  1. 1 1
      app/router/command/command.go
  2. 4 4
      proxy/shadowsocks/config.go
  3. 1 1
      proxy/shadowsocks/protocol.go

+ 1 - 1
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

+ 4 - 4
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
 }
 

+ 1 - 1
proxy/shadowsocks/protocol.go

@@ -19,7 +19,7 @@ import (
 )
 
 const (
-	Version                               = 1
+	Version = 1
 )
 
 var addrParser = protocol.NewAddressParser(