1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

Infra: use customized goimports (#949)

This commit is contained in:
Loyalsoldier 2021-05-01 11:11:37 +08:00 committed by GitHub
parent 7e876709fe
commit 0fe129de65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
package core package core
//go:generate go install -v golang.org/x/tools/cmd/goimports@latest //go:generate go install -v github.com/v2fly/tools/cmd/goimports@latest
//go:generate go run ./infra/vformat/ //go:generate go run ./infra/vformat/

View File

@ -154,7 +154,8 @@ func main() {
filename := filepath.Base(path) filename := filepath.Base(path)
if strings.HasSuffix(filename, ".go") && if strings.HasSuffix(filename, ".go") &&
!strings.HasSuffix(filename, ".pb.go") && !strings.HasSuffix(filename, ".pb.go") &&
!strings.Contains(dir, filepath.Join("testing", "mocks")) { !strings.Contains(dir, filepath.Join("testing", "mocks")) &&
!strings.Contains(path, filepath.Join("main", "distro", "all", "all.go")) {
rawFilesSlice = append(rawFilesSlice, path) rawFilesSlice = append(rawFilesSlice, path)
} }
@ -171,6 +172,7 @@ func main() {
goimportsArgs := []string{ goimportsArgs := []string{
"-w", "-w",
"-r",
"-local", "github.com/v2fly/v2ray-core", "-local", "github.com/v2fly/v2ray-core",
} }