From 97739d12d1af87db4ffa7ac83d8dd3085830ff1d Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Thu, 10 Oct 2019 11:42:34 +0200 Subject: [PATCH] use golangci-lint v1.20 --- .travis.yml | 2 +- Makefile | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a353b8c..6bfaebef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ git: depth: 1 install: true before_script: -- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${GOPATH}/bin v1.17.1 +- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.20.0 - go get github.com/mitchellh/gox@v1.0.1 script: - make fmt check build-cross diff --git a/Makefile b/Makefile index e99dc6e3..a7e11682 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,11 @@ BINARIES := k3d # Go Package required PKG_GOX := github.com/mitchellh/gox@v1.0.1 -PKG_GOLANGCI_LINT := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1 +PKG_GOLANGCI_LINT_VERSION := v1.20.0 +PKG_GOLANGCI_LINT := github.com/golangci/golangci-lint/cmd/golangci-lint@${PKG_GOLANGCI_LINT_VERSION} # configuration adjustments for golangci-lint -GOLANGCI_LINT_DISABLED_LINTERS := typecheck # disabling typecheck, because it currently (06.09.2019) fails with Go 1.13 +GOLANGCI_LINT_DISABLED_LINTERS := "" # disabling typecheck, because it currently (06.09.2019) fails with Go 1.13 # Use Go Modules for everything export GO111MODULE=on @@ -44,7 +45,7 @@ export GO111MODULE=on # DIRS defines a single level directly, we only look at *.go in this directory. # REC_DIRS defines a source code tree. All go files are analyzed recursively. DIRS := . -REC_DIRS := cmd +REC_DIRS := cli # Rules for finding all go source files using 'DIRS' and 'REC_DIRS' GO_SRC := $(foreach dir,$(DIRS),$(wildcard $(dir)/*.go)) @@ -58,7 +59,7 @@ LINT_DIRS := $(DIRS) $(foreach dir,$(REC_DIRS),$(dir)/...) all: clean fmt check build build: - $(GO) build -i $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINARIES)' + CGO_ENABLED=0 $(GO) build -i $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINARIES)' build-cross: LDFLAGS += -extldflags "-static" build-cross: @@ -68,8 +69,8 @@ clean: @rm -rf $(BINDIR) _dist/ extra-clean: clean - go clean -i $(PKG_GOX) - go clean -i $(PKG_GOLANGCI_LINT) + $(GO) clean -i $(PKG_GOX) + $(GO) clean -i $(PKG_GOLANGCI_LINT) # fmt will fix the golang source style in place. fmt: @@ -90,8 +91,8 @@ HAS_GOLANGCI := $(shell command -v golangci-lint 2> /dev/null) install-tools: ifndef HAS_GOX - (go get $(PKG_GOX)) + ($(GO) get $(PKG_GOX)) endif ifndef HAS_GOLANGCI - (curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${GOPATH}/bin v1.19.1) + (curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${GOPATH}/bin ${PKG_GOLANGCI_LINT_VERSION}) endif