diff --git a/Makefile b/Makefile index 7106ddc129a..6a87614ac4f 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,9 @@ install-golint: ## check golint if not exist install golint tools ifeq (, $(shell which golangci-lint)) @{ \ set -e ;\ - o install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0 ;\ + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0 ;\ } -GOLINT_BIN=$(GOBIN)/golangci-lint +GOLINT_BIN=$(shell go env GOPATH)/bin/golangci-lint else GOLINT_BIN=$(shell which golangci-lint) endif diff --git a/hack/make-rules/check_license.sh b/hack/make-rules/check_license.sh index 160435adcb9..ffbd0394349 100755 --- a/hack/make-rules/check_license.sh +++ b/hack/make-rules/check_license.sh @@ -23,7 +23,7 @@ set -u licRes=$( find . -type f -regex '.*\.go\|.*\.sh' ! -path '*/vendor/*' -exec \ - sh -c 'head -n4 $1 | grep -Eq "(Copyright|generated|GENERATED)" || echo -e $1' {} {} \; + sh -c 'head -n5 $1 | grep -Eq "(Copyright|generated|GENERATED)" || echo -e $1' {} {} \; ) if [ -n "${licRes}" ]; then diff --git a/pkg/util/iptables/iptables_linux.go b/pkg/util/iptables/iptables_linux.go index c28fd62dda8..94202e3de6b 100644 --- a/pkg/util/iptables/iptables_linux.go +++ b/pkg/util/iptables/iptables_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/pkg/util/iptables/iptables_test.go b/pkg/util/iptables/iptables_test.go index 1022ba85d65..416a0de1885 100644 --- a/pkg/util/iptables/iptables_test.go +++ b/pkg/util/iptables/iptables_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/pkg/util/iptables/iptables_unsupported.go b/pkg/util/iptables/iptables_unsupported.go index c6a5f0d7dc6..a11f936cf51 100644 --- a/pkg/util/iptables/iptables_unsupported.go +++ b/pkg/util/iptables/iptables_unsupported.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux /* diff --git a/pkg/util/iptables/monitor_test.go b/pkg/util/iptables/monitor_test.go index 06465987097..16f911ffeaa 100644 --- a/pkg/util/iptables/monitor_test.go +++ b/pkg/util/iptables/monitor_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/pkg/yurthub/network/dummyif_test.go b/pkg/yurthub/network/dummyif_test.go index 7e10fb34564..16c1f6f542c 100644 --- a/pkg/yurthub/network/dummyif_test.go +++ b/pkg/yurthub/network/dummyif_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/pkg/yurthub/network/dummyif_unsupported.go b/pkg/yurthub/network/dummyif_unsupported.go index f972412e49b..88db0077693 100644 --- a/pkg/yurthub/network/dummyif_unsupported.go +++ b/pkg/yurthub/network/dummyif_unsupported.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux /*