logo

Using awk to colorize go output

From my StackOverflow answer on the subject of colorizing Golang test run output: I like piping to a simple awk script to colorize output from other shell commands. That way, you can customize with whatever colors/patterns suit you. You want to colorize an output unique to your project? Go for it. Simply save this awk script to ./bin/colorize in your project, chmod u+x ./bin/colorize, and customize to your needs: #!/usr/bin/awk -f # colorize - add color to go test output # usage: # go test .
One minute to read