From eba38ee157e8f03fdf7b8f485ae5879ad9516c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 14 Sep 2024 14:40:11 +0800 Subject: [PATCH] Fix linter configuration --- .golangci.yml | 22 +++++++++++++++------- tun_linux.go | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7aa7aff..c4599a5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,18 +3,26 @@ linters: enable: - gofumpt - govet -# - gci + - gci - staticcheck + - paralleltest + - ineffassign issues: exclude-dirs: - internal linters-settings: -# gci: -# sections: -# - standard -# - prefix(github.com/sagernet/sing) -# - default + gci: + custom-order: true + sections: + - standard + - prefix(github.com/sagernet/) + - default staticcheck: - go: '1.19' + checks: + - all + - -SA1003 + +run: + go: "1.23" \ No newline at end of file diff --git a/tun_linux.go b/tun_linux.go index 6153abe..2a1f5d6 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -712,7 +712,7 @@ func (t *NativeTun) rules() []*netlink.Rule { it.Family = unix.AF_INET rules = append(rules, it) } - priority++ + //priority++ } if p6 { it = netlink.NewRule() @@ -755,7 +755,7 @@ func (t *NativeTun) rules() []*netlink.Rule { it.Table = t.options.IPRoute2TableIndex it.Family = unix.AF_INET6 rules = append(rules, it) - priority6++ + //priority6++ } if p4 { it = netlink.NewRule()