Documentation
¶
Overview ¶
unexportedglobal is a linter for Go code that verifies that unexported global variables and constants are prefixed with '_' in their names.
Usage ¶
To use this linter, run the 'unexportedglobal' binary directly:
$ unexportedglobal ./...
Alternatively, you can use the 'go vet' command:
$ go vet -vettool=$(which unexportedglobal) ./...
golangci-lint plugin ¶
You can use it as a golangci-lint plugin. First, build it as a plugin:
$ go build -buildmode=plugin go.abhg.dev/unexportedglobal/cmd/unexportedglobal
Then enable it in the golangci-lint configuration:
$ cat .golangci.yml linter-settings: custom: unexportedglobal: path: unexportedglobal.so description: Verify unexported globals have an underscore prefix. original-url: go.abhg.dev/unexportedglobal
Click to show internal directories.
Click to hide internal directories.