A tool that prints warnings in Go source files.
To install gwarn, run:
$ go get -u github.com/asib/gwarnGwarn recognises any comment that begins //:warning
To run gwarn on all .go files in the current directory and all subdirectories recursively:
$ gwarnTo run gwarn on all .go files in a specific directory (use flag -r to recurse into subdirectories):
$ gwarn dir /path/to/dirTo run gwarn on a specific file:
$ gwarn file /path/to/file.goIf you're still unsure:
$ gwarn help// main.go
package main
func main() {
//:warning This is a warning that gwarn will see
}You can then run:
$ gwarn file main.goand gwarn will output:
/path/to/file/main.go:5: This is a warning that gwarn will seeBuilt with kingpin.