Skip to content
/ goban Public

linter that bans usage of certain methods and functions

License

Notifications You must be signed in to change notification settings

utrack/goban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goban

goban is a Go(lang) linter that bans usage of user-supplied list of functions.

Usage

goban -cfg goban.cfg ./...

Config

Config is a newline-delimited list of banned symbols. Comments start with pound symbol (#).

Examples:

# bans method `url.Query()` on type *net/url.URL
(*net/url.URL).Query

# bans `context.TODO()`
context.TODO
# or
context.TODO()

# bans first-party imports of `foo/bar`
foo/bar

If symbol has a comment on the same line - then it is printed along with the report.

fmt.Errorf # use pkg/errors instead yields /path/to/file/foo.go:145:15: fmt.Errorf is banned - use pkg/errors instead

TODO

  • Ban variables as well
  • Support wildcards for rules

About

linter that bans usage of certain methods and functions

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages