A tool that prints warnings in Go source files.
Built with kingpin.
To install gwarn, run:
$ go get -u github.com/asib/gwarn
Gwarn recognises any comment that begins //:warning
.
To run gwarn on all .go
files in the current directory and all subdirectories
recursively:
$ gwarn
To run gwarn on all .go
files in a specific directory (use flag -r
to recurse
into subdirectories):
$ gwarn dir /path/to/dir
To run gwarn on a specific file:
$ gwarn file /path/to/file.go
If 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.go
and gwarn will output:
/path/to/file/main.go:5: This is a warning that gwarn will see