Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing in Go

There are a number of convetions on how to write tests in Go.

  • Tests files have a suffix _test like app_test.go.
  • They have functions where the name starts with Test like TestSometing.
  • You can run the tests by typing go test in the directory of the project.