From 0f17a1d7b66be3aa6fcb5fe996d5ff812ad49c3c Mon Sep 17 00:00:00 2001 From: carr0t2 Date: Fri, 21 Oct 2022 13:27:54 +0800 Subject: [PATCH 1/5] fix: log error --- cmd/hack-browser-data/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/hack-browser-data/main.go b/cmd/hack-browser-data/main.go index 0b1ea46..9aa0e35 100644 --- a/cmd/hack-browser-data/main.go +++ b/cmd/hack-browser-data/main.go @@ -72,6 +72,7 @@ func Execute() { } err := app.Run(os.Args) if err != nil { + log.Init("debug") log.Error(err) } } From b8759530e96a0d74f7e4480ee76ffa39ee40f6cf Mon Sep 17 00:00:00 2001 From: carr0t2 Date: Mon, 24 Oct 2022 01:12:00 +0800 Subject: [PATCH 2/5] fix: remove deprecated linter --- .golangci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 9702cb9..c549e50 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,7 +8,6 @@ run: linters: enable: - 'asciicheck' - - 'deadcode' - 'depguard' - 'dogsled' - 'errorlint' @@ -29,7 +28,8 @@ linters: - 'revive' - 'typecheck' - 'unconvert' - - 'varcheck' +# The linter 'varcheck' 'deadcode' 'structcheck' is deprecated (since v1.49.0), use 'unused' instead. + - 'unused' - 'whitespace' disable: # unsupported lint with golang 1.18+ ref: https://github.com/golangci/golangci-lint/issues/2649 @@ -38,9 +38,7 @@ linters: - 'noctx' - 'sqlclosecheck' - 'staticcheck' - - 'structcheck' - 'stylecheck' - - 'unused' - 'errcheck' issues: @@ -62,8 +60,6 @@ issues: exclude-rules: - path: internal/browser/browser\.go linters: - - 'deadcode' - - 'varcheck' - 'unused' max-issues-per-linter: 0 max-same-issues: 0 From 8a952f8baaca4cb639eac9a8d543146e15bea209 Mon Sep 17 00:00:00 2001 From: moonD4rk Date: Mon, 24 Oct 2022 13:59:57 +0800 Subject: [PATCH 3/5] chore: remove cmd folder from git ignore config --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7d7934a..85d4ac9 100644 --- a/.gitignore +++ b/.gitignore @@ -190,4 +190,4 @@ result/ results/ hack-browser-data -!/hack-browser-data \ No newline at end of file +!/cmd/hack-browser-data \ No newline at end of file From 9976fe0ea10b474c1373513454d8309ae64ec343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Mon, 24 Oct 2022 14:19:29 +0800 Subject: [PATCH 4/5] fix: init log error --- cmd/hack-browser-data/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/hack-browser-data/main.go b/cmd/hack-browser-data/main.go index 16e4c86..fbe7298 100644 --- a/cmd/hack-browser-data/main.go +++ b/cmd/hack-browser-data/main.go @@ -1,6 +1,7 @@ package main import ( + glog "log" "os" "strings" @@ -69,7 +70,6 @@ func Execute() { } err := app.Run(os.Args) if err != nil { - log.Init("debug") - log.Error(err) + glog.Fatal(err) } } From 01b2bc582b59f59884897870ca0bc04a596476ff Mon Sep 17 00:00:00 2001 From: moonD4rk Date: Sun, 30 Oct 2022 12:58:35 +0800 Subject: [PATCH 5/5] fix: handle err run binary failed --- cmd/hack-browser-data/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/hack-browser-data/main.go b/cmd/hack-browser-data/main.go index fbe7298..0c85c01 100644 --- a/cmd/hack-browser-data/main.go +++ b/cmd/hack-browser-data/main.go @@ -1,7 +1,6 @@ package main import ( - glog "log" "os" "strings" @@ -70,6 +69,6 @@ func Execute() { } err := app.Run(os.Args) if err != nil { - glog.Fatal(err) + panic(err) } }