Skip to content

Commit

Permalink
Fix coding style lints
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed Mar 15, 2024
1 parent 04275b6 commit 85b04d1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/router/strategy_random.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion common/dice/dice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion infra/conf/v4/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion infra/conf/v4/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions proxy/shadowsocks2022/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 85b04d1

Please sign in to comment.