From a18233167c3224cafbec59239766a4b1257ba5e0 Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Mon, 17 Apr 2023 03:15:08 +0800 Subject: [PATCH] lint --- .golangci.yml | 15 +++++++++++++++ main.go | 4 ++-- pkg/node/node.go | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..0052e3b --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,15 @@ +run: + skip-dirs-use-default: false + +linters: + enable: + - gofmt + - gocyclo + - misspell + - bodyclose + +gocyclo: + min-complexity: 15 + +issues: + exclude-use-default: false diff --git a/main.go b/main.go index f621f0d..83a94e4 100644 --- a/main.go +++ b/main.go @@ -80,8 +80,8 @@ func main() { return } - os.Setenv(USE_NODE_SHELL, "true") - os.Setenv(PATH, strings.Join([]string{binPath, getEnvWithoutOtherUseNode()}, string(os.PathListSeparator))) + utils.E(os.Setenv(USE_NODE_SHELL, "true")) + utils.E(os.Setenv(PATH, strings.Join([]string{binPath, getEnvWithoutOtherUseNode()}, string(os.PathListSeparator)))) bin, err := Shell() utils.E(err) diff --git a/pkg/node/node.go b/pkg/node/node.go index 1a6ac31..52ccef7 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -26,7 +26,7 @@ func GetNodePath(required string, logger fetchup.Logger) string { return nodePath } - os.RemoveAll(nodePath) + _ = os.RemoveAll(nodePath) fu := fetchup.New(nodePath, n.URLs()...)