Documentation ¶
Overview ¶
requiredfield is a linter for Go code that checks for missing required fields in struct literals. See top-level package documentation for more information on the linter.
Usage ¶
To use this linter, install the requiredfield binary:
$ go install go.abhg.dev/requiredfield/cmd/requiredfield@latest
Pass the path to this file to 'go vet':
$ go vet -vettool=$(which requiredfield) ./...
As a golangci-lint plugin ¶
Build the plugin:
$ go build -buildmode=plugin go.abhg.dev/requiredfield/cmd/requiredfield
Then enable it in the golangci-lint configuration:
$ cat .golangci.yml linter-settings: custom: requiredfield: path: requiredfield.so description: Checks for required fields in structs original-url: go.abhg.dev/requiredfield
Click to show internal directories.
Click to hide internal directories.