adds go fmt to do.sh commands and makes indents friendlier spaced
This commit is contained in:
25
do.sh
25
do.sh
@@ -5,21 +5,28 @@
|
|||||||
set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors"
|
set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
echo "I am ${FUNCNAME[0]}ing"
|
echo "I am ${FUNCNAME[0]}ing"
|
||||||
go version
|
go version
|
||||||
go build
|
go build
|
||||||
}
|
}
|
||||||
|
|
||||||
test() {
|
test() {
|
||||||
_lint && _vet && _test
|
echo "I am ${FUNCNAME[0]}ing"
|
||||||
|
_lint && _vet && _test
|
||||||
}
|
}
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
test && go run main.go
|
echo "I am ${FUNCNAME[0]}ing"
|
||||||
|
fmt && test && go run main.go
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt() {
|
||||||
|
echo "I am ${FUNCNAME[0]}ing"
|
||||||
|
go fmt ./...
|
||||||
}
|
}
|
||||||
|
|
||||||
_test() {
|
_test() {
|
||||||
go test -v -coverprofile=coverage.out -covermode count ./... | tee tests.out
|
go test -v -coverprofile=coverage.out -covermode count ./... | tee tests.out
|
||||||
}
|
}
|
||||||
|
|
||||||
_testhtml() {
|
_testhtml() {
|
||||||
@@ -27,15 +34,15 @@ _testhtml() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_lint() {
|
_lint() {
|
||||||
golint -set_exit_status ./...
|
golint -set_exit_status ./...
|
||||||
}
|
}
|
||||||
|
|
||||||
_vet() {
|
_vet() {
|
||||||
go vet ./...
|
go vet ./...
|
||||||
}
|
}
|
||||||
|
|
||||||
all() {
|
all() {
|
||||||
test && build
|
fmt && test && build
|
||||||
}
|
}
|
||||||
|
|
||||||
"$@" # <- execute the task
|
"$@" # <- execute the task
|
||||||
|
|||||||
Reference in New Issue
Block a user