Skip to content

asib/gwarn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

gwarn

A tool that prints warnings in Go source files.

Built with kingpin.

Install

To install gwarn, run:

$ go get -u github.com/asib/gwarn

Usage

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

Example

// 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

About

A tool that prints warnings in Go source files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages