Created
January 4, 2018 15:58
-
-
Save graphaelli/43dac2c8a6534b317feb7ceb74ef756f to your computer and use it in GitHub Desktop.
go utils
This file contains hidden or 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 -e | |
if [ ! -d ${GOPATH} ]; then | |
echo missing GOPATH | |
exit 1 | |
fi | |
mv ${GOPATH} ${GOPATH}.$(date '+%Y%m%d_%H%M%S') | |
mkdir -p ${GOPATH} | |
go get -u -v \ | |
github.com/golang/dep/cmd/dep \ | |
github.com/kardianos/govendor \ | |
github.com/nsf/gocode \ | |
golang.org/x/review/git-codereview \ | |
golang.org/x/tools/... |
This file contains hidden or 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 | |
go test -covermode=count -coverprofile=/tmp/$$_count.out $@ | |
go tool cover -html=/tmp/$$_count.out |
This file contains hidden or 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 | |
TARGET=${1:-"./..."} | |
gotest() { | |
clear | |
go test $TARGET | |
echo $? | |
} | |
gotest | |
export -f gotest | |
export TARGET | |
fswatch -o *go | xargs -t -I{} bash -c gotest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment