Skip to content

Commit 2436175

Browse files
committed
add gofmt
1 parent ca4c3a3 commit 2436175

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

do.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,16 @@ _has_license() {
288288
}
289289

290290
profile() {
291-
echo "for profiling to work you may need uncomment the code in main.go"
291+
echo "for profiling to work you may need to uncomment the code in main.go"
292292
build
293293
./vouch-proxy -profile
294294
go tool pprof -http=0.0.0.0:19091 http://0.0.0.0:9090/debug/pprof/profile?seconds=10
295-
296295
}
297296

297+
gofmt() {
298+
# segfault's without exec, hmmm
299+
exec gofmt -w -s .
300+
}
298301

299302
usage() {
300303
cat <<EOF
@@ -303,6 +306,7 @@ usage() {
303306
$0 build - go build
304307
$0 install - move binary to ${GOPATH}/bin/vouch
305308
$0 goget - get all dependencies
309+
$0 gofmt - gofmt the entire code base
306310
$0 dbuild - build docker container
307311
$0 drun [args] - run docker container
308312
$0 test [./pkg_test.go] - run go tests (defaults to all tests)
@@ -325,7 +329,7 @@ EOF
325329
ARG=$1;
326330

327331
case "$ARG" in
328-
'run'|'build'|'dbuild'|'drun'|'install'|'test'|'goget'|'gogo'|'watch'|'gobuildstatic'|'coverage'|'stats'|'usage'|'bug_report'|'test_logging'|'license'|'profile')
332+
'run'|'build'|'dbuild'|'drun'|'install'|'test'|'goget'|'gogo'|'watch'|'gobuildstatic'|'coverage'|'stats'|'usage'|'bug_report'|'test_logging'|'license'|'profile'|'gofmt')
329333
shift
330334
$ARG $*
331335
;;

0 commit comments

Comments
 (0)