Last active
August 19, 2016 18:04
-
-
Save teepark/03fba013c21aa992fd75dffe4e987a37 to your computer and use it in GitHub Desktop.
colorful go test output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
go test "$@" | \ | |
sed -E \ | |
-e "/^((--- PASS:.*)|(ok.*)|(PASS.*))$/s//$(printf '\033[32m\\1\033[0m')/" \ | |
-e "/^(\\?.*\\[no test files\\])$/s//$(printf '\033[33m\\1\033[0m')/" \ | |
-e "/^(FAIL.*|--- FAIL:.*)$/s//$(printf '\033[31m\\1\033[0m')/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment