From 1485ae03f0ad90496ad7626a5ae4a6a73a1f6296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hoshea=C2=A0Jiang?= Date: Wed, 8 Nov 2023 18:40:52 +0800 Subject: [PATCH] make linter happy (#125) --- .golangci.yml | 9 ++------- Makefile | 2 +- cmd/e2e/main.go | 2 +- commands/cleanup/cleanup.go | 2 +- commands/root.go | 2 +- commands/run/run.go | 2 +- commands/trigger/trigger.go | 2 +- commands/version.go | 2 +- internal/components/trigger/http.go | 1 + internal/components/verifier/funcs.go | 2 +- internal/logger/log.go | 2 +- 11 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 91d074d3..1e9901e5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -36,11 +36,6 @@ linters-settings: goconst: min-len: 2 min-occurrences: 2 - depguard: - list-type: blacklist - include-go-root: true - packages-with-error-messages: - fmt: "logging is allowed only by logutils.Log" misspell: locale: US ignore-words: @@ -98,7 +93,6 @@ linters-settings: linters: enable: - deadcode - - depguard - dogsled - dupl - errcheck @@ -115,7 +109,6 @@ linters: - ineffassign - lll - misspell - - nakedret - staticcheck - stylecheck - typecheck @@ -125,6 +118,8 @@ linters: - whitespace disable: - structcheck + - depguard + - nakedret service: golangci-lint-version: 1.20.x diff --git a/Makefile b/Makefile index bf5deb69..78797b48 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ all: clean lint test build .PHONY: lint lint: - $(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v1.46.2" + $(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v1.55.2" $(GO_LINT) run -v --timeout 5m ./... .PHONY: fix-lint diff --git a/cmd/e2e/main.go b/cmd/e2e/main.go index 04222413..ee599dbc 100644 --- a/cmd/e2e/main.go +++ b/cmd/e2e/main.go @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -// + package main import ( diff --git a/commands/cleanup/cleanup.go b/commands/cleanup/cleanup.go index 3e7079d9..fdc5daaa 100644 --- a/commands/cleanup/cleanup.go +++ b/commands/cleanup/cleanup.go @@ -1,4 +1,3 @@ -// // Licensed to Apache Software Foundation (ASF) under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright @@ -15,6 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + package cleanup import ( diff --git a/commands/root.go b/commands/root.go index 1fec7872..31e3c8f8 100644 --- a/commands/root.go +++ b/commands/root.go @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -// + package commands import ( diff --git a/commands/run/run.go b/commands/run/run.go index fef97d35..a304779d 100644 --- a/commands/run/run.go +++ b/commands/run/run.go @@ -1,4 +1,3 @@ -// // Licensed to Apache Software Foundation (ASF) under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright @@ -15,6 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + package run import ( diff --git a/commands/trigger/trigger.go b/commands/trigger/trigger.go index ca82261d..cb49b54b 100644 --- a/commands/trigger/trigger.go +++ b/commands/trigger/trigger.go @@ -1,4 +1,3 @@ -// // Licensed to Apache Software Foundation (ASF) under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright @@ -15,6 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + package trigger import ( diff --git a/commands/version.go b/commands/version.go index 0b073161..3ac00627 100644 --- a/commands/version.go +++ b/commands/version.go @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -// + package commands var version string diff --git a/internal/components/trigger/http.go b/internal/components/trigger/http.go index 3d620624..aa95bf2d 100644 --- a/internal/components/trigger/http.go +++ b/internal/components/trigger/http.go @@ -15,6 +15,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + package trigger import ( diff --git a/internal/components/verifier/funcs.go b/internal/components/verifier/funcs.go index dc1fb090..f0ca3d40 100644 --- a/internal/components/verifier/funcs.go +++ b/internal/components/verifier/funcs.go @@ -31,7 +31,7 @@ import ( // funcMap produces the custom function map. // Use this to pass the functions into the template engine: -// tpl := template.New("foo").Funcs(funcMap())) +// tpl := template.New("foo").Funcs(funcMap())) func funcMap() template.FuncMap { fm := make(map[string]any, len(customFuncMap)) for k, v := range customFuncMap { diff --git a/internal/logger/log.go b/internal/logger/log.go index 1c641e8a..cdc63533 100644 --- a/internal/logger/log.go +++ b/internal/logger/log.go @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -// + package logger import (