Go testing examples
Some test writing examples in Golang.
☝️ Every folder contains a different testing methods using standard libraries, convey and fuzz testing.
👉 We tried to keep it as simple as possible to make the logic behind the test as clear as possible.
How to run test:
- checkout selected folder e.g.
$ cd compare
$ go mod init example.com/mto initialize a v0 or v1 module
$ go mod tidyto create go.mod file
- finally, run the test by
$ go test✅
Check test coverage:
if you want to double-check if your cover 100% or not
$ go test -cover😎