Chore: use golangci-lint config file

This commit is contained in:
gVisor bot 2022-02-19 00:08:51 +08:00
parent 47359cc80f
commit ef86484c70
3 changed files with 17 additions and 3 deletions

14
.golangci.yaml Normal file
View File

@ -0,0 +1,14 @@
linters:
disable-all: true
enable:
- gofumpt
- megacheck
- govet
- gci
linters-settings:
gci:
sections:
- standard
- prefix(github.com/Dreamacro/clash)
- default

View File

@ -114,7 +114,7 @@ all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)
releases: $(gz_releases) $(zip_releases)
lint:
golangci-lint run --disable-all -E govet -E gofumpt -E megacheck ./...
golangci-lint run ./...
clean:
rm $(BINDIR)/*

View File

@ -4,9 +4,9 @@ import (
"net"
"syscall"
"golang.org/x/sys/unix"
"github.com/Dreamacro/clash/component/iface"
"golang.org/x/sys/unix"
)
type controlFn = func(network, address string, c syscall.RawConn) error