mirror of https://github.com/v2ray/v2ray-core
adjust lint settings
parent
be6f44e1d7
commit
483a56c847
|
@ -4,7 +4,11 @@
|
||||||
|
|
||||||
"go.lintTool": "gometalinter",
|
"go.lintTool": "gometalinter",
|
||||||
"go.lintFlags": [
|
"go.lintFlags": [
|
||||||
"--enable-gc"
|
"--enable-gc",
|
||||||
|
"--no-config",
|
||||||
|
"--exclude=.*\\.pb\\.go",
|
||||||
|
"--concurrency=2",
|
||||||
|
"--disable=gas"
|
||||||
],
|
],
|
||||||
"go.formatTool": "goimports",
|
"go.formatTool": "goimports",
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,9 @@ func (l *OutboundListener) add(conn net.Conn) {
|
||||||
select {
|
select {
|
||||||
case l.buffer <- conn:
|
case l.buffer <- conn:
|
||||||
case <-l.done.Wait():
|
case <-l.done.Wait():
|
||||||
common.Ignore(conn.Close(), "We can do nothing if Close() returns error.")
|
conn.Close() // nolint: errcheck
|
||||||
default:
|
default:
|
||||||
common.Ignore(conn.Close(), "We can do nothing if Close() returns error.")
|
conn.Close() // nolint: errcheck
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ L:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case c := <-l.buffer:
|
case c := <-l.buffer:
|
||||||
common.Ignore(c.Close(), "We can do nothing if errored.")
|
c.Close() // nolint: errcheck
|
||||||
default:
|
default:
|
||||||
break L
|
break L
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,10 +138,10 @@ func (g *Instance) Close() error {
|
||||||
|
|
||||||
g.active = false
|
g.active = false
|
||||||
|
|
||||||
common.Ignore(common.Close(g.accessLogger), "Recycling it anyway")
|
common.Close(g.accessLogger) // nolint: errcheck
|
||||||
g.accessLogger = nil
|
g.accessLogger = nil
|
||||||
|
|
||||||
common.Ignore(common.Close(g.errorLogger), "Recycling this too")
|
common.Close(g.errorLogger) // nolint: errcheck
|
||||||
g.errorLogger = nil
|
g.errorLogger = nil
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -21,6 +21,3 @@ func Must2(v interface{}, err error) interface{} {
|
||||||
func Error2(v interface{}, err error) error {
|
func Error2(v interface{}, err error) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore an error with reason, for lint purpose.
|
|
||||||
func Ignore(err error, reason string) {}
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
||||||
if invalidRequestErr != nil {
|
if invalidRequestErr != nil {
|
||||||
randomLen := dice.Roll(64) + 1
|
randomLen := dice.Roll(64) + 1
|
||||||
// Read random number of bytes for prevent detection.
|
// Read random number of bytes for prevent detection.
|
||||||
common.Ignore(buffer.AppendSupplier(buf.ReadFullFrom(decryptor, int32(randomLen))), "Error doesn't matter")
|
buffer.AppendSupplier(buf.ReadFullFrom(decryptor, int32(randomLen))) // nolint: errcheck
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue