testing - colorizing golang test run output -
i when terminal/console test runs show output in either red or green text. seems lot of testing libraries available go have this. however, i'd use default testing package comes go. there way colorize it's output red , green?
you can create wrapper shell script , color using color escape sequence. here's simple example on linux (i'm not sure how on windows, guess there way.. :) )
go test -v . | sed ''/pass/s//$(printf "\033[32mpass\033[0m")/'' | sed ''/fail/s//$(printf "\033[31mfail\033[0m")/''
Comments
Post a Comment