Browse Source

Fix coding style lints

Shelikhoo 1 year ago
parent
commit
85b04d1af9

+ 2 - 1
app/router/strategy_random.go

@@ -3,13 +3,14 @@ package router
 import (
 	"context"
 
+	"google.golang.org/protobuf/runtime/protoiface"
+
 	core "github.com/v2fly/v2ray-core/v5"
 	"github.com/v2fly/v2ray-core/v5/app/observatory"
 	"github.com/v2fly/v2ray-core/v5/common"
 	"github.com/v2fly/v2ray-core/v5/common/dice"
 	"github.com/v2fly/v2ray-core/v5/features"
 	"github.com/v2fly/v2ray-core/v5/features/extension"
-	"google.golang.org/protobuf/runtime/protoiface"
 )
 
 // RandomStrategy represents a random balancing strategy

+ 2 - 1
common/dice/dice.go

@@ -4,11 +4,12 @@ package dice
 
 import (
 	crand "crypto/rand"
-	"github.com/v2fly/v2ray-core/v5/common"
 	"io"
 	"math/big"
 	"math/rand"
 	"time"
+
+	"github.com/v2fly/v2ray-core/v5/common"
 )
 
 // Roll returns a non-negative number between 0 (inclusive) and n (exclusive).

+ 1 - 1
infra/conf/v4/trojan.go

@@ -141,7 +141,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
 			return nil, newError(`Trojan fallbacks: "path" must be empty or start with "/"`)
 		}
 		if fb.Type == "" && fb.Dest != "" {
-			if fb.Dest == "serve-ws-none" {
+			if fb.Dest == "serve-ws-none" { // nolint:gocritic
 				fb.Type = "serve"
 			} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
 				fb.Type = "unix"

+ 1 - 1
infra/conf/v4/vless.go

@@ -90,7 +90,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
 			return nil, newError(`VLESS fallbacks: "path" must be empty or start with "/"`)
 		}
 		if fb.Type == "" && fb.Dest != "" {
-			if fb.Dest == "serve-ws-none" {
+			if fb.Dest == "serve-ws-none" { // nolint:gocritic
 				fb.Type = "serve"
 			} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
 				fb.Type = "unix"

+ 2 - 3
proxy/shadowsocks2022/encoding.go

@@ -5,16 +5,15 @@ import (
 	"crypto/cipher"
 	cryptoRand "crypto/rand"
 	"encoding/binary"
-	"github.com/v2fly/v2ray-core/v5/common/dice"
 	"io"
 	"time"
 
-	"github.com/v2fly/v2ray-core/v5/common"
-
 	"github.com/lunixbochs/struc"
 
+	"github.com/v2fly/v2ray-core/v5/common"
 	"github.com/v2fly/v2ray-core/v5/common/buf"
 	"github.com/v2fly/v2ray-core/v5/common/crypto"
+	"github.com/v2fly/v2ray-core/v5/common/dice"
 	"github.com/v2fly/v2ray-core/v5/common/net"
 	"github.com/v2fly/v2ray-core/v5/common/protocol"
 )