To use the test runner:
- navigate into the ./cmd directory
- if run with the defaults (
go run .), the application will run in asynchronous mode and write it's output directly to the shell- the
-outflag allows a destination file to be specified - the
-asyncflag determines if the logger will asynchronously or not. It is async by default, which will not work properly in the application's initial condition.
- the
To run the tests
- use the
go testcommand from the command line - to focus on a specific test, use the
-runflag followed by a pattern that matches the test name- e.g.
go test -run MessageChannelwill run the first test of the first module
- e.g.
- all tests for a given module can be run by passing the module identifier to the
-runcommand- e.g.
go test -v -run Module1
- e.g.