File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11language : go
22go :
3+ - 1.6
34 - 1.5.3
45 - 1.4.3
56 - 1.3.3
@@ -8,13 +9,13 @@ sudo: false
89
910before_install :
1011 - go get golang.org/x/tools/cmd/vet
11- - go get github.com/golang/lint/golint
12+ - go version | (grep -q 'go1.[56]' || exit 0 && go get -u github.com/golang/lint/golint )
1213 - go get github.com/vbatts/git-validation
1314
1415install : true
1516
1617script :
1718 - go vet -x ./...
18- - $HOME/gopath/bin/golint ./...
19+ - make .golint
1920 - $HOME/gopath/bin/git-validation -run DCO,short-subject -v -range ${TRAVIS_COMMIT_RANGE}
2021
Original file line number Diff line number Diff line change 4040 vbatts/pandoc -f markdown_github -t html5 -o /output/docs.html $(patsubst % ,/input/% ,$(DOC_FILES ) ) && \
4141 ls -sh $(shell readlink -f output/docs.html)
4242
43+
44+ HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
45+ # this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
46+ ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1 ) \n$(2 ) " | sort -V | head -n1) ' == '$(1 ) ' && echo 'true')
47+
4348.PHONY : test .govet .golint .gitvalidation
4449
4550test : .govet .golint .gitvalidation
@@ -50,7 +55,10 @@ test: .govet .golint .gitvalidation
5055
5156# `go get github.com/golang/lint/golint`
5257.golint :
58+ ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION ) ) ,true)
5359 golint ./...
60+ endif
61+
5462
5563# `go get github.com/vbatts/git-validation`
5664.gitvalidation :
You can’t perform that action at this time.
0 commit comments