mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
Fix coding style lints
This commit is contained in:
parent
04275b6991
commit
85b04d1af9
@ -3,13 +3,14 @@ package router
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/runtime/protoiface"
|
||||||
|
|
||||||
core "github.com/v2fly/v2ray-core/v5"
|
core "github.com/v2fly/v2ray-core/v5"
|
||||||
"github.com/v2fly/v2ray-core/v5/app/observatory"
|
"github.com/v2fly/v2ray-core/v5/app/observatory"
|
||||||
"github.com/v2fly/v2ray-core/v5/common"
|
"github.com/v2fly/v2ray-core/v5/common"
|
||||||
"github.com/v2fly/v2ray-core/v5/common/dice"
|
"github.com/v2fly/v2ray-core/v5/common/dice"
|
||||||
"github.com/v2fly/v2ray-core/v5/features"
|
"github.com/v2fly/v2ray-core/v5/features"
|
||||||
"github.com/v2fly/v2ray-core/v5/features/extension"
|
"github.com/v2fly/v2ray-core/v5/features/extension"
|
||||||
"google.golang.org/protobuf/runtime/protoiface"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RandomStrategy represents a random balancing strategy
|
// RandomStrategy represents a random balancing strategy
|
||||||
|
@ -4,11 +4,12 @@ package dice
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
crand "crypto/rand"
|
crand "crypto/rand"
|
||||||
"github.com/v2fly/v2ray-core/v5/common"
|
|
||||||
"io"
|
"io"
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/v2fly/v2ray-core/v5/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Roll returns a non-negative number between 0 (inclusive) and n (exclusive).
|
// Roll returns a non-negative number between 0 (inclusive) and n (exclusive).
|
||||||
|
@ -141,7 +141,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
|
|||||||
return nil, newError(`Trojan fallbacks: "path" must be empty or start with "/"`)
|
return nil, newError(`Trojan fallbacks: "path" must be empty or start with "/"`)
|
||||||
}
|
}
|
||||||
if fb.Type == "" && fb.Dest != "" {
|
if fb.Type == "" && fb.Dest != "" {
|
||||||
if fb.Dest == "serve-ws-none" {
|
if fb.Dest == "serve-ws-none" { // nolint:gocritic
|
||||||
fb.Type = "serve"
|
fb.Type = "serve"
|
||||||
} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
|
} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
|
||||||
fb.Type = "unix"
|
fb.Type = "unix"
|
||||||
|
@ -90,7 +90,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
|
|||||||
return nil, newError(`VLESS fallbacks: "path" must be empty or start with "/"`)
|
return nil, newError(`VLESS fallbacks: "path" must be empty or start with "/"`)
|
||||||
}
|
}
|
||||||
if fb.Type == "" && fb.Dest != "" {
|
if fb.Type == "" && fb.Dest != "" {
|
||||||
if fb.Dest == "serve-ws-none" {
|
if fb.Dest == "serve-ws-none" { // nolint:gocritic
|
||||||
fb.Type = "serve"
|
fb.Type = "serve"
|
||||||
} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
|
} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {
|
||||||
fb.Type = "unix"
|
fb.Type = "unix"
|
||||||
|
@ -5,16 +5,15 @@ import (
|
|||||||
"crypto/cipher"
|
"crypto/cipher"
|
||||||
cryptoRand "crypto/rand"
|
cryptoRand "crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"github.com/v2fly/v2ray-core/v5/common/dice"
|
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/v2fly/v2ray-core/v5/common"
|
|
||||||
|
|
||||||
"github.com/lunixbochs/struc"
|
"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/buf"
|
||||||
"github.com/v2fly/v2ray-core/v5/common/crypto"
|
"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/net"
|
||||||
"github.com/v2fly/v2ray-core/v5/common/protocol"
|
"github.com/v2fly/v2ray-core/v5/common/protocol"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user