From ee2176392815cdc98b0a5b29fd9ba565ebf7ebb5 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sun, 18 Jun 2023 17:42:17 +0000 Subject: [PATCH] Run "go fmt ./..." --- app/router/condition_test.go | 4 ++-- infra/conf/vmess.go | 4 ++-- proxy/vmess/encoding/auth.go | 2 +- proxy/vmess/inbound/inbound.go | 10 +++++----- proxy/vmess/outbound/command.go | 2 +- proxy/vmess/validator.go | 2 +- transport/internet/headers/dns/dns.go | 6 +++--- transport/internet/quic/dialer.go | 2 +- transport/internet/quic/hub.go | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/router/condition_test.go b/app/router/condition_test.go index ca1999ef..395a04c9 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -307,8 +307,8 @@ func TestRoutingRule(t *testing.T) { }, { rule: &RoutingRule{ - Protocol: []string{"http"}, - Attributes: map[string]string { + Protocol: []string{"http"}, + Attributes: map[string]string{ ":path": "/test", }, }, diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index e3361646..93d0e75b 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -37,7 +37,7 @@ func (a *VMessAccount) Build() *vmess.Account { st = protocol.SecurityType_AUTO } return &vmess.Account{ - Id: a.ID, + Id: a.ID, SecuritySettings: &protocol.SecurityConfig{ Type: st, }, @@ -61,7 +61,7 @@ type FeaturesConfig struct { } type VMessDefaultConfig struct { - Level byte `json:"level"` + Level byte `json:"level"` } // Build implements Buildable diff --git a/proxy/vmess/encoding/auth.go b/proxy/vmess/encoding/auth.go index 5d9623b1..99bdaa49 100644 --- a/proxy/vmess/encoding/auth.go +++ b/proxy/vmess/encoding/auth.go @@ -17,7 +17,7 @@ func Authenticate(b []byte) uint32 { return fnv1hash.Sum32() } -// [DEPRECATED 2023-06] +// [DEPRECATED 2023-06] type NoOpAuthenticator struct{} func (NoOpAuthenticator) NonceSize() int { diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index f427bc6b..f48a26e1 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -30,14 +30,14 @@ import ( type userByEmail struct { sync.Mutex - cache map[string]*protocol.MemoryUser - defaultLevel uint32 + cache map[string]*protocol.MemoryUser + defaultLevel uint32 } func newUserByEmail(config *DefaultConfig) *userByEmail { return &userByEmail{ - cache: make(map[string]*protocol.MemoryUser), - defaultLevel: config.Level, + cache: make(map[string]*protocol.MemoryUser), + defaultLevel: config.Level, } } @@ -68,7 +68,7 @@ func (v *userByEmail) Get(email string) (*protocol.MemoryUser, bool) { if !found { id := uuid.New() rawAccount := &vmess.Account{ - Id: id.String(), + Id: id.String(), } account, err := rawAccount.AsAccount() common.Must(err) diff --git a/proxy/vmess/outbound/command.go b/proxy/vmess/outbound/command.go index 07df935c..2d4747dc 100644 --- a/proxy/vmess/outbound/command.go +++ b/proxy/vmess/outbound/command.go @@ -11,7 +11,7 @@ import ( func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) { rawAccount := &vmess.Account{ - Id: cmd.ID.String(), + Id: cmd.ID.String(), SecuritySettings: &protocol.SecurityConfig{ Type: protocol.SecurityType_AUTO, }, diff --git a/proxy/vmess/validator.go b/proxy/vmess/validator.go index 6cc96927..bc844061 100644 --- a/proxy/vmess/validator.go +++ b/proxy/vmess/validator.go @@ -15,7 +15,7 @@ import ( // TimedUserValidator is a user Validator based on time. type TimedUserValidator struct { sync.RWMutex - users []*protocol.MemoryUser + users []*protocol.MemoryUser behaviorSeed uint64 behaviorFused bool diff --git a/transport/internet/headers/dns/dns.go b/transport/internet/headers/dns/dns.go index df209ff6..b6345213 100644 --- a/transport/internet/headers/dns/dns.go +++ b/transport/internet/headers/dns/dns.go @@ -36,7 +36,7 @@ func NewDNS(ctx context.Context, config interface{}) (interface{}, error) { buf := make([]byte, 0x100) - off1, err := packDomainName(config.(*Config).Domain + ".", buf) + off1, err := packDomainName(config.(*Config).Domain+".", buf) if err != nil { return nil, err } @@ -62,8 +62,8 @@ func packDomainName(s string, msg []byte) (off1 int, err error) { // Emit sequence of counted strings, chopping at dots. var ( - begin int - bs []byte + begin int + bs []byte ) for i := 0; i < ls; i++ { var c byte diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index f0d8e4e1..f6083561 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -143,7 +143,7 @@ func (s *clientConnections) openConnection(ctx context.Context, destAddr net.Add HandshakeIdleTimeout: time.Second * 8, MaxIdleTimeout: time.Second * 300, Tracer: func(ctx context.Context, p logging.Perspective, ci quic.ConnectionID) logging.ConnectionTracer { - return qlog.NewConnectionTracer( &QlogWriter{connID: ci}, p, ci); + return qlog.NewConnectionTracer(&QlogWriter{connID: ci}, p, ci) }, } udpConn, _ := rawConn.(*net.UDPConn) diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index 15f072ec..8bab5bf3 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -109,7 +109,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti MaxIncomingStreams: 32, MaxIncomingUniStreams: -1, Tracer: func(ctx context.Context, p logging.Perspective, ci quic.ConnectionID) logging.ConnectionTracer { - return qlog.NewConnectionTracer( &QlogWriter{connID: ci}, p, ci); + return qlog.NewConnectionTracer(&QlogWriter{connID: ci}, p, ci) }, }