Go Check
Use go vet to examine Go source code and report suspicious constructs
that the compiler might not catch.
Usage
To vet the current package:
go vet ./...
To vet a specific package:
go vet ./pkg/mypackage
Common Options
-v— verbose output, listing checked files-json— output diagnostics in JSON format-vettool=path— use an external vet tool
Analyzers
go vet runs several built-in analyzers including:
printf— check printf-style format stringsshadow— check for shadowed variablesstructtag— check struct field tags conform toreflect.StructTag.Getunusedresult— check for unused results of calls to certain functions