fix(lint):err check rules and fix config
This commit is contained in:
+35
-27
@@ -1,35 +1,43 @@
|
|||||||
version: 2
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
tests: true
|
tests: true
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
- errcheck
|
- errcheck
|
||||||
- govet
|
- govet
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- errorlint
|
- errorlint
|
||||||
- errname
|
- errname
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- sqlclosecheck
|
- sqlclosecheck
|
||||||
- noctx
|
- noctx
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- unconvert
|
- unconvert
|
||||||
- bidichk
|
- bidichk
|
||||||
|
settings:
|
||||||
linters-settings:
|
|
||||||
errcheck:
|
errcheck:
|
||||||
check-type-assertions: true
|
check-type-assertions: true
|
||||||
check-blank: true
|
check-blank: false
|
||||||
|
exclude-functions:
|
||||||
|
- fmt.Print
|
||||||
|
- fmt.Println
|
||||||
|
- fmt.Printf
|
||||||
|
- fmt.Fprint
|
||||||
|
- fmt.Fprintln
|
||||||
|
- fmt.Fprintf
|
||||||
govet:
|
govet:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
- fieldalignment
|
- fieldalignment
|
||||||
|
exclusions:
|
||||||
|
rules:
|
||||||
|
- linters: [errcheck]
|
||||||
|
source: "^\\s*defer "
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-use-default: false
|
max-issues-per-linter: 0
|
||||||
max-issues-per-linter: 0
|
max-same-issues: 0
|
||||||
max-same-issues: 0
|
|
||||||
+4
-1
@@ -24,7 +24,10 @@ func NewServer() (*Server, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
localAddr := conn.LocalAddr().(*net.UDPAddr)
|
localAddr, ok := conn.LocalAddr().(*net.UDPAddr)
|
||||||
|
if !ok {
|
||||||
|
return nil, net.InvalidAddrError("not a UDP address")
|
||||||
|
}
|
||||||
|
|
||||||
s := &Server{
|
s := &Server{
|
||||||
conn: conn,
|
conn: conn,
|
||||||
|
|||||||
Reference in New Issue
Block a user