mirror of
https://github.com/rancher/cli.git
synced 2026-02-05 09:48:36 +01:00
Update build process
Problem: The cli is using an old go version It does not use all the validation tools rancher/rancher uses Solution: Update to go version 1.12.9 Include goimports for validation
This commit is contained in:
committed by
Craig Jellick
parent
8c5d6c3630
commit
a8000549ed
@@ -3,17 +3,14 @@ set -e
|
||||
|
||||
cd $(dirname $0)/..
|
||||
|
||||
echo Running validation
|
||||
|
||||
echo Running: go vet
|
||||
go vet ./...
|
||||
|
||||
echo Running: golint
|
||||
# use go list until golint acts the same as go-1.9 and ignores vendor with ./...
|
||||
if [ -n "$(golint $(go list ./...) | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
|
||||
failed=true
|
||||
fi
|
||||
test -z "$failed"
|
||||
|
||||
echo Running: go fmt
|
||||
test -z "$(go fmt ./... | tee /dev/stderr)"
|
||||
|
||||
echo Running: go vet
|
||||
test -z "$(go vet ./... 2>&1 | tee /dev/stderr)"
|
||||
|
||||
echo Running: golint
|
||||
test -z "$(go list ./... | grep -v /vendor/ | xargs -L1 golint | grep -v 'or be unexported' | tee /dev/stderr)"
|
||||
|
||||
echo Running: goimports
|
||||
test -z "$(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*") | tee /dev/stderr)"
|
||||
|
||||
Reference in New Issue
Block a user