Merge pull request #156 from vbatts/go_versions

ci: fix dep failure, add go versions
This commit is contained in:
Vincent Batts 2020-04-02 12:22:37 -04:00 committed by GitHub
commit f849a9299a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -1,6 +1,9 @@
language: go
go:
- "1.x"
- "1.14.x"
- "1.13.x"
- "1.12.x"
- "1.11.x"
- "1.10.x"
- "1.9.x"

View file

@ -6,6 +6,7 @@ SOURCE_FILES := $(shell find . -type f -name "*.go")
CLEAN_FILES := *~
TAGS :=
ARCHES := linux,386 linux,amd64 linux,arm linux,arm64 openbsd,amd64 windows,amd64 darwin,amd64
GO_VER := go1.14
default: build validation
@ -33,10 +34,10 @@ lint: .lint
CLEAN_FILES += .lint
.lint: $(SOURCE_FILES)
if [[ "$(go version |awk '{ print $3 }')" =~ ^go1\.11\. ]] ; then \
set -e ; for dir in $(NO_VENDOR_DIR) ; do golint -set_exit_status $$dir ; done && touch $@ \
@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 $@ ; \
touch $@ ; \
fi
.PHONY: vet
@ -68,8 +69,10 @@ $(BUILD): $(SOURCE_FILES)
go build -o $(BUILD) $(BUILDPATH)
install.tools:
go get -u -v github.com/golang/dep/cmd/dep
if [[ "$(go version |awk '{ print $3 }')" =~ ^go1\.11\. ]] ; then go get -u golang.org/x/lint/golint ; fi
@go get -u github.com/fatih/color ; \
if [[ "$(findstring $(GO_VER),$(shell go version))" != "" ]] ; then \
go get -u golang.org/x/lint/golint ;\
fi
./bin:
mkdir -p $@