Created
September 14, 2014 04:16
-
-
Save corsc/3e767a1f5abe5999619b to your computer and use it in GitHub Desktop.
Sample Golang cleanup & check script
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
#!/bin/bash | |
# ====================== | |
# Download the tools | |
# ====================== | |
go get code.google.com/p/go.tools/cmd/goimports | |
go get github.com/golang/lint/golint | |
# ====================== | |
# Clean the Code | |
# ====================== | |
echo "\nCleaning the code" | |
gofmt -w -l ./ | |
# ====================== | |
# Fix the imports | |
# ====================== | |
echo "\nFixing the imports" | |
goimports -w -l ./ | |
# ====================== | |
# Check for bugs | |
# ====================== | |
echo "\nVetting" | |
go tool vet ./dir1/ | |
go tool vet ./dir2/ | |
# ====================== | |
# Check for lint errors | |
# ====================== | |
echo "\nChecking for bugs" | |
golint ./ | |
golint ./dir1/ | |
golint ./dir2/ | |
echo "\nDone" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment