-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from skx/8-install
Updated install instructions
- Loading branch information
Showing
2 changed files
with
31 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Install tools to test our code-quality. | ||
go get -u golang.org/x/lint/golint | ||
# I don't even .. | ||
go env -w GOFLAGS="-buildvcs=false" | ||
|
||
# Failures cause aborts | ||
# Install the tools we use to test our code-quality. | ||
# | ||
# Here we setup the tools to install only if the "CI" environmental variable | ||
# is not empty. This is because locally I have them installed. | ||
# | ||
# NOTE: Github Actions always set CI=true | ||
# | ||
if [ -n "${CI}" ] ; then | ||
go install golang.org/x/lint/golint@latest | ||
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
fi | ||
|
||
# Run the static-check tool | ||
t=$(mktemp) | ||
staticcheck -checks all ./... | grep -v "is deprecated"> "$t" | ||
if [ -s "$t" ]; then | ||
echo "Found errors via 'staticcheck'" | ||
cat "$t" | ||
rm "$t" | ||
exit 1 | ||
fi | ||
rm "$t" | ||
|
||
# At this point failures cause aborts | ||
set -e | ||
|
||
# Run the linter | ||
echo "Launching linter .." | ||
golint -set_exit_status ./... | ||
echo "Completed linter .." | ||
|
||
# Run the vet-checker. | ||
echo "Launching go vet check .." | ||
go vet ./... | ||
echo "Completed go vet check .." | ||
|
||
# Run the shadow-checker | ||
echo "Launching shadowed-variable check .." | ||
go vet -vettool="$(which shadow)" ./... | ||
echo "Completed shadowed-variable check .." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters