January 27, 2019
Learning Go, so started recording references to all the useful things I find so I can find them again when I need them..
$ brew update && brew install go
or download from Golang Downloads and install
$ go test
- run tests
gotests - Generate Go tests from your source code
$ gotests -w -all ./client.go > client_test.go
$ go test -cover
- run tests and write coverage profile to cover.out
$ go tool cover -html=cover.out
- view covered/not covered code in browser
go tool cover -help
- for more
Cleaning the go caches once fixed some “unknown import path”/“cannot find module providing package” errors (Package Clean)
$ go clean -cache -modcache -i -r
Blog Posts
Written by Jason Galea from Cairns, Australia.
I work at SafetyCulture on the SafetyCulture web app, with React & Node, backing the awsome iAuditor mobile app for iOS and Android.