Golang Unit Test
Basic
Tools
- testify
- mockgen
Get coverage
go test -coveror
go test -cover ./...or
go test -coverprofile=coverage.out ./... ; go tool cover -func=coverage.outor to check the source code
go test -coverprofile=coverage.out ./... ; go tool cover -html=coverage.out