This is a basic repository I use for testing gotest
, which provides colorful output, compared to the standard test tool.
Standard go toolchain:
go test -v
Using gotest
gotest -v
I use this repository for testing my contributions to gotest
gotest -v github.com/jonasbn/go-test-demo
Do note that the above example expects for you to be in a directory containing a Go module project or else you will observe the following error:
no required module provides package github.com/jonasbn/go-test-demo: go.mod file not found in current directory or any parent directory; see 'go help modules'
You can do the following to get the demo to work, if you are not in the context of a Go module - it could be any, you could even fork and clone this here repository.
- Create a directory
- Initialize as a Go module
- Install this demo
- Run the
gotest
command
mkdir gonow && \
go mod init example.com/gonow && \
go get github.com/jonasbn/go-test-demo
And then you should be good to go
gotest -v github.com/jonasbn/go-test-demo