Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ci: no-exit: Do not run no-exit check on test files
Browse files Browse the repository at this point in the history
The test files do not have access to our app level
exit() function, and are thus OK to call os.Exit() if
they need. Skip them from the check.

Signed-off-by: Graham Whaley <[email protected]>
  • Loading branch information
Graham Whaley authored and Eric Ernst committed Aug 23, 2018
1 parent b71cae0 commit b4595ae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .ci/go-no-os-exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ echo "Checking for no os.Exit() calls for package [${go_packages}]"
candidates=`go list -f '{{.Dir}}/*.go' $go_packages`
for f in $candidates; do
filename=`basename $f`
# skip all go test files
[[ $filename == *_test.go ]] && continue
# skip exit.go where, the only file we should call os.Exit() from.
[[ $filename == "exit.go" ]] && continue
# skip exit_test.go
[[ $filename == "exit_test.go" ]] && continue
# skip main_test.go
[[ $filename == "main_test.go" ]] && continue
files="$f $files"
done

Expand Down

0 comments on commit b4595ae

Please sign in to comment.