Skip to content

Instantly share code, notes, and snippets.

@Teqqles
Last active August 5, 2021 13:08
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 Teqqles/22b67a17a9bb616f1b4618e211beac3b to your computer and use it in GitHub Desktop.
Save Teqqles/22b67a17a9bb616f1b4618e211beac3b to your computer and use it in GitHub Desktop.
Setting Up GRC for colourised output of golang tests

Install GRC

brew install grc

Create a config directory in your home directory:

mkdir ~/.grc

Then create your personal grc config in ~/.grc/grc.conf:

# Go
\bgo.* test\b
conf.gotest

Then create a Go test colourization config in ~/.grc/conf.gotest, such as:

regexp==== RUN .*
colour=blue
-
regexp=--- PASS: .*
colour=green
-
regexp=^PASS$
colour=green
-
regexp=^(ok|\?) .*
colour=magenta
-
regexp=--- FAIL: .*
colour=red
-
regexp=^FAIL.*
colour=red
-
regexp=[^\s]+\.go(:\d+)?
colour=cyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment