mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-15 21:00:27 +00:00
Fix lint errors
This commit is contained in:
@@ -31,6 +31,7 @@ linters:
|
|||||||
- -QF1008 # could remove embedded field "<interface>" from selector
|
- -QF1008 # could remove embedded field "<interface>" from selector
|
||||||
- -ST1003 # should not use ALL_CAPS in Go names; use CamelCase instead
|
- -ST1003 # should not use ALL_CAPS in Go names; use CamelCase instead
|
||||||
- -QF1001 # could apply De Morgan's law
|
- -QF1001 # could apply De Morgan's law
|
||||||
|
- -SA4023 # impossible nil comparison, false positive on platform-specific implementations
|
||||||
exclusions:
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
presets:
|
presets:
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ func (c *linuxTransportCredentials) ServerHandshake(rawConnection net.Conn) (net
|
|||||||
func (c *linuxTransportCredentials) Info() credentials.ProtocolInfo {
|
func (c *linuxTransportCredentials) Info() credentials.ProtocolInfo {
|
||||||
return credentials.ProtocolInfo{
|
return credentials.ProtocolInfo{
|
||||||
SecurityProtocol: "linux-local-process",
|
SecurityProtocol: "linux-local-process",
|
||||||
SecurityVersion: "1",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ func (c *windowsTransportCredentials) serverHandshake(rawConnection net.Conn) (n
|
|||||||
func (c *windowsTransportCredentials) Info() credentials.ProtocolInfo {
|
func (c *windowsTransportCredentials) Info() credentials.ProtocolInfo {
|
||||||
return credentials.ProtocolInfo{
|
return credentials.ProtocolInfo{
|
||||||
SecurityProtocol: "windows-local-process",
|
SecurityProtocol: "windows-local-process",
|
||||||
SecurityVersion: "1",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ func (b *backendBase) AttachReturn(returnPath tun.Return) error {
|
|||||||
if slices.Contains(b.returnPaths, returnPath) {
|
if slices.Contains(b.returnPaths, returnPath) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
b.returnPaths = append(b.returnPaths[:len(b.returnPaths):len(b.returnPaths)], returnPath)
|
b.returnPaths = append(slices.Clip(b.returnPaths), returnPath)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
|||||||
tlsConfig.SetNextProtos([]string{http2.NextProtoTLS})
|
tlsConfig.SetNextProtos([]string{http2.NextProtoTLS})
|
||||||
}
|
}
|
||||||
dialOptions = append(dialOptions, grpc.WithTransportCredentials(NewTLSTransportCredentials(tlsConfig)))
|
dialOptions = append(dialOptions, grpc.WithTransportCredentials(NewTLSTransportCredentials(tlsConfig)))
|
||||||
|
if tlsConfig.ServerName() != "" {
|
||||||
|
dialOptions = append(dialOptions, grpc.WithAuthority(tlsConfig.ServerName()))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dialOptions = append(dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
dialOptions = append(dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ func NewTLSTransportCredentials(config tls.Config) credentials.TransportCredenti
|
|||||||
func (c *TLSTransportCredentials) Info() credentials.ProtocolInfo {
|
func (c *TLSTransportCredentials) Info() credentials.ProtocolInfo {
|
||||||
return credentials.ProtocolInfo{
|
return credentials.ProtocolInfo{
|
||||||
SecurityProtocol: "tls",
|
SecurityProtocol: "tls",
|
||||||
SecurityVersion: "1.2",
|
|
||||||
ServerName: c.config.ServerName(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user