ALPHA VERSION
usually, there is a good choice that is go tool vet
, golint
or any more. But:
- Cannot to select specific checks for subpackages or subfiles.
- Cannot to add special (not provided by the tool) checks.
- Check with toolset is slowly, like gometalinter
- Not better engineering support.
so, it was coded.
Run go run main.go check
to experience.
- config
govet.yaml
- run
govet check
$ govet -h
Usage:
govet [command]
Available Commands:
check Run check on the project
help Help about any command
Flags:
--choke int maximum number of complaining message (default 30)
-h, --help help for govet
Use "govet [command] --help" for more information about a command.
main config fileds:
field | type | default | meaning |
---|---|---|---|
choke | integer | 20 | choked abort line number |
ignored | string array | nil | ignored sub packages or files |
enabled | string array | all checkers | enabled checkers |
disabled | string array | nil | disabled checkers |
override | object array | nil | overrided config of sub packages or files |
checker | object array | nil | checkers define |
override config fileds:
field | type | default | meaning |
---|---|---|---|
package | string | nil | sub package of overrided |
file | string | nil | sub file |
enabled | string array | all checkers | enabled checkers |
disabled | string array | nil | disabled checkers |
checker config fileds:
field | type | meaning |
---|---|---|
name | string | name of checker |
goastch | string | go ast matcher |
message | string | abort message |
Package
: all packages of current projectGovet.toml
: govet config fileConfig Unmarshal
: config parserParser & Type Checker
: go parser & type checkerSchedule
: schedule checkersChecks
: checkers and checked packages/filesVet
: run checkers and complaintComplaint Output
: complaint messages