Skip to content

Instantly share code, notes, and snippets.

@laser
Last active June 12, 2018 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laser/d17034a1f035730a9ee0a15503d9e347 to your computer and use it in GitHub Desktop.
Save laser/d17034a1f035730a9ee0a15503d9e347 to your computer and use it in GitHub Desktop.
How to Run All Tests in a Single Go File
go test ./... \
-v \
-run "$(cat commands/foo_test.go \
| grep -oE "^func Test[^(]*" \
| sed -e "s/func //" \
| tr "\n" "|" \
| sed -e "s/|$//")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment