Skip to content
linter that bans usage of certain methods and functions
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/goban
goban rules: same-line comments are printed in a report Jan 13, 2020
.gitignore
.goreleaser.yml
LICENSE Initial commit Jan 10, 2020
README.md rules: same-line comments are printed in a report Jan 13, 2020
go.mod
go.sum

README.md

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

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
You can’t perform that action at this time.