4 ms·
Go with warning flag patch also upgraded to 1.14: https://github.com/kstenerud/go#the-go-programming-language https://github.com/kstenerud/go#the-go-programming
by kstenerud 7y ago
Go with warning flag patch also upgraded to 1.14: https://github.com/kstenerud/go#the-go-programming-language https://github.com/kstenerud/go#the-go-programming-language
The warning flag patch allows you to do:
go build -gcflags=-warnunused
go test -gcflags=-warnunused
which causes the compiler to only warn about unused things instead of stopping the build:
$ go test -gcflags=-warnunused
# github.com/kstenerud/go-describe
./describe_unsafe.go:8:2: Warning: imported and not used: "fmt"
./describe.go:329:2: Warning: isInUnsignedArray declared but not used
...
PASS
ok github.com/kstenerud/go-describe 0.002s
I use this when debugging or for exploratory coding.