til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Enriched Test Output

I have earlier used the colorful test tool for go gotest (see: Colorful Test Output).

Recently I fell over: richgo which is way more flexibleā€¦ and complex.

It lets you:

  • specify colors for test outcomes
  • style of output when building
  • style of outputs for test outcomes
  • and probably some stuff I have not yet gotten my hands on

You can specify it globally or per project using a configuration file

I can recommend copying in the example with the defaults explicitly defined and then starting to customise from there

labelType: long
buildStyle:
  bold: true
  foreground: yellow
startStyle:
  foreground: lightBlack
passStyle:
  foreground: green
failStyle:
  bold: true
  foreground: red
skipStyle:
  foreground: lightBlack
passPackageStyle:
  foreground: green
  hide: true
failPackageStyle:
  bold: true
  foreground: red
  hide: true
coverThreshold: 50
coveredStyle:
  foreground: green
uncoveredStyle:
  bold: true
  foreground: yellow
fileStyle:
  foreground: cyan
lineStyle:
  foreground: magenta

Resources and References