From 911d9759b9c810a5df445411ae6544e446f29367 Mon Sep 17 00:00:00 2001 From: MSI Date: Tue, 2 May 2023 14:10:17 +0200 Subject: [PATCH] update lint issues --- .golangci.yml | 2 +- cmd/hostctl/actions/post_action.go | 2 +- cmd/hostctl/actions/sync_docker_test.go | 2 +- pkg/docker/docker_test.go | 4 ++-- pkg/parser/docker_test.go | 2 +- pkg/parser/parser.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1341951..f58bb3a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -78,7 +78,7 @@ linters: - misspell - nakedret - noctx - - nolintlint + # - nolintlint - rowserrcheck - scopelint - staticcheck diff --git a/cmd/hostctl/actions/post_action.go b/cmd/hostctl/actions/post_action.go index cdb1d02..c25b7f3 100644 --- a/cmd/hostctl/actions/post_action.go +++ b/cmd/hostctl/actions/post_action.go @@ -74,7 +74,7 @@ func postActionCmd(cmd *cobra.Command, args []string, postCmd *cobra.Command, li func waitSignalOrDuration(d time.Duration) <-chan struct{} { done := make(chan struct{}) - sig := make(chan os.Signal) + sig := make(chan os.Signal, 1) if d < 0 { d = -d diff --git a/cmd/hostctl/actions/sync_docker_test.go b/cmd/hostctl/actions/sync_docker_test.go index 0a56c89..2b6a5ed 100644 --- a/cmd/hostctl/actions/sync_docker_test.go +++ b/cmd/hostctl/actions/sync_docker_test.go @@ -36,7 +36,7 @@ func newClientWithResponse(t *testing.T, resp map[string]string) *client.Client t.Helper() v := "1.22" - c, err := client.NewClient("tcp://fake:2345", v, + c, err := client.NewClient("tcp://fake:2345", v, //nolint: staticcheck &http.Client{ Transport: transportFunc(func(req *http.Request) (*http.Response, error) { url := req.URL.Path diff --git a/pkg/docker/docker_test.go b/pkg/docker/docker_test.go index 7d81982..601b04e 100644 --- a/pkg/docker/docker_test.go +++ b/pkg/docker/docker_test.go @@ -102,7 +102,7 @@ func newClientWithResponse(t *testing.T, resp map[string]string) *client.Client t.Helper() v := "1.22" - c, err := client.NewClient("tcp://fake:2345", v, + c, err := client.NewClient("tcp://fake:2345", v, //nolint: staticcheck &http.Client{ Transport: transportFunc(func(req *http.Request) (*http.Response, error) { url := req.URL.Path @@ -116,7 +116,7 @@ func newClientWithResponse(t *testing.T, resp map[string]string) *client.Client }, nil }), }, - map[string]string{}) + map[string]string{}) //nolint: staticcheck assert.NoError(t, err) diff --git a/pkg/parser/docker_test.go b/pkg/parser/docker_test.go index 96b47d9..6e4658b 100644 --- a/pkg/parser/docker_test.go +++ b/pkg/parser/docker_test.go @@ -130,7 +130,7 @@ func newClientWithResponse(t *testing.T, resp map[string]string) *client.Client t.Helper() v := "1.22" - c, err := client.NewClient("tcp://fake:2345", v, + c, err := client.NewClient("tcp://fake:2345", v, //nolint: staticcheck &http.Client{ Transport: transportFunc(func(req *http.Request) (*http.Response, error) { url := req.URL.Path diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 6280695..c8f62d2 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -146,7 +146,7 @@ func parseRouteLine(str string) (*types.Route, bool) { if len(clean) == 0 { return nil, false } - + result := endingComment.FindStringSubmatch(clean) tResult := strings.TrimSpace(result[1]) p := strings.Split(tResult, " ")