1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-24 23:30:28 +00:00

*.go: update to golangci-lint, and fix everything

install tools in the workflow actions
Also switch away from deprecated ioutil

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-10-23 21:45:19 -04:00
parent e7a79ae8a7
commit 42b655d8ee
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED
19 changed files with 101 additions and 78 deletions

View file

@ -11,7 +11,7 @@ GO_VER := go1.14
default: build validation
.PHONY: validation
validation: .test .lint .vet .cli.test
validation: .test .vet .cli.test
.PHONY: validation.tags
validation.tags: .test.tags .vet.tags .cli.test .staticcheck
@ -50,11 +50,7 @@ lint: .lint
CLEAN_FILES += .lint
.lint: $(SOURCE_FILES)
@if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \
set -e ; for dir in $(NO_VENDOR_DIR) ; do golint -set_exit_status $$dir ; done && touch $@ \
else \
touch $@ ; \
fi
set -e ; golangci-lint run && touch $@
.PHONY: vet
vet: .vet .vet.tags
@ -85,12 +81,10 @@ $(BUILD): $(SOURCE_FILES)
go build -ldflags="-X 'main.Version=$(shell git describe --always --dirty)'" -mod=vendor -o $(BUILD) $(BUILDPATH)
install.tools:
@go install -u github.com/fatih/color@latest ; \
go install -u github.com/fzipp/gocyclo/cmd/gocyclo@latest ; \
go install -u honnef.co/go/tools/cmd/staticcheck@latest ; \
if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \
go get -u golang.org/x/lint/golint ;\
fi
@go install github.com/fatih/color@latest ; \
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest ; \
go install honnef.co/go/tools/cmd/staticcheck@latest ; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
./bin:
mkdir -p $@