Skip to content

Instantly share code, notes, and snippets.

@nik-don
Last active November 3, 2021 11:00
Show Gist options
  • Save nik-don/e88dd0e519ff6d693bd8212d148df152 to your computer and use it in GitHub Desktop.
Save nik-don/e88dd0e519ff6d693bd8212d148df152 to your computer and use it in GitHub Desktop.
[Go Testing]
  • Test files end with _test.go

  • Use Log to print

Log formats its arguments using default formatting, analogous to Println, and records the text in the error log. For tests, the text will be printed only if the test fails or the -test.v flag is set.
For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment