1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-01 15:18:20 +00:00

Updated dapper files

Migrated to SUSE containers, a newer version of Go, and using golangci-lint for all linting.
This commit is contained in:
Steffan Tucker
2022-07-07 18:54:04 -06:00
parent e21cabdc65
commit e8b47ab4c4
2 changed files with 11 additions and 24 deletions

View File

@@ -5,16 +5,10 @@ cd $(dirname $0)/..
echo Running validation
PACKAGES="$(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
if ! command -v golangci-lint; then
echo Skipping validation: no golangci-lint available
exit
fi
echo Running: go vet
go vet ${PACKAGES}
echo Running: golint
for i in ${PACKAGES}; do
if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
failed=true
fi
done
test -z "$failed"
echo Running: go fmt
test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"
echo Running: golangci-lint
golangci-lint run