From 0d4b6655afa0ff5d0445a2e5a0b9eac6fa7205b8 Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 1 May 2022 01:10:30 +0800 Subject: [PATCH 1/3] Fix: gci command for formatting code --- infra/vformat/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/infra/vformat/main.go b/infra/vformat/main.go index 6e895e59f29..30197420cf1 100644 --- a/infra/vformat/main.go +++ b/infra/vformat/main.go @@ -170,8 +170,12 @@ func main() { } goimportsArgs := []string{ - "-w", - "-local", "github.com/v2fly/v2ray-core", + "write", + "--NoInlineComments", + "--NoPrefixComments", + "--Section", "Standard", + "--Section", "Default", + "--Section", "pkgPrefix(github.com/v2fly/v2ray-core)", } RunMany(gofmt, gofmtArgs, rawFilesSlice) From 26e376718462a542d749b86c8d8aaf1c1c25305e Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 1 May 2022 01:10:44 +0800 Subject: [PATCH 2/3] Chore: format code --- proxy/vmess/encoding/commands_test.go | 2 +- transport/internet/headers/http/linkedreadRequest.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/proxy/vmess/encoding/commands_test.go b/proxy/vmess/encoding/commands_test.go index 4c85bfcb561..cb9cc8f889e 100644 --- a/proxy/vmess/encoding/commands_test.go +++ b/proxy/vmess/encoding/commands_test.go @@ -1,10 +1,10 @@ package encoding_test import ( - "github.com/stretchr/testify/assert" "testing" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" "github.com/v2fly/v2ray-core/v4/common" "github.com/v2fly/v2ray-core/v4/common/buf" diff --git a/transport/internet/headers/http/linkedreadRequest.go b/transport/internet/headers/http/linkedreadRequest.go index 35154b8710c..1b7fc3607e6 100644 --- a/transport/internet/headers/http/linkedreadRequest.go +++ b/transport/internet/headers/http/linkedreadRequest.go @@ -3,8 +3,6 @@ package http import ( "bufio" "net/http" - - // required to use go:linkname _ "unsafe" ) From 9c5b65b452bfdff47d4c41fdb0ecfac072786b3d Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 1 May 2022 01:11:22 +0800 Subject: [PATCH 3/3] Fix: replace golint with revive --- .github/linters/.golangci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml index 22829352ea2..332f8cff394 100644 --- a/.github/linters/.golangci.yml +++ b/.github/linters/.golangci.yml @@ -2,14 +2,12 @@ run: timeout: 5m skip-files: - generated.* - issues: new: true exclude-rules: - linters: - - staticcheck + - staticcheck text: "SA1019:" - linters: enable: - asciicheck @@ -19,13 +17,13 @@ linters: - gofmt - gofumpt - goimports - - golint - goprintffuncname - gosimple - govet - ineffassign - misspell - nakedret + - revive - rowserrcheck - staticcheck - structcheck @@ -39,7 +37,11 @@ linters: - deadcode - errcheck - unused - linters-settings: goimports: local-prefixes: github.com/v2fly/v2ray-core + revive: + rules: + - name: blank-imports + severity: warning + disabled: true