go tool vet

Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.


Go Versions


Go Versions

Supported Languages


Official Documentation


YAML Configuration


  • input:

    Patterns to include in execution and reports.

    Note: Inspecode runs go tool vet for each Go package directory and go tool vet processes all files in the directory recursively. The input patterns are used for selecting the directories containing input files. Therefore, the files excluded by the patterns are processed if they are contained in Go packages that also contain input files, and you may even see logs related to the excluded files in the job console. However, Inspecode eventually ignores any issues detected on the excluded files when generating job reports.

  • ignore:

    Patterns to exclude from execution and reports.

    Note: Just like input:, the ignore patterns may not be applied completely when running go tool vet.

  • auto-fix:


  • config-file:


  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

       enable asmdecl analysis
       enable assign analysis
       enable atomic analysis
       enable bools analysis
       enable buildtag analysis
       enable cgocall analysis
       enable composites analysis
       use composite white list; for testing only (default true)
       enable copylocks analysis
       enable errorsas analysis
       enable httpresponse analysis
       enable loopclosure analysis
       enable lostcancel analysis
       enable nilfunc analysis
       enable printf analysis
    -printf.funcs value
       comma-separated list of print function names to check (default (*log.Logger).Fatal,(*log.Logger).Fatalf,(*log.Logger).Fatalln,(*log.Logger).Panic,(*log.Logger).Panicf,(*log.Logger).Panicln,(*log.Logger).Print,(*log.Logger).Printf,(*log.Logger).Println,(*testing.common).Error,(*testing.common).Errorf,(*testing.common).Fatal,(*testing.common).Fatalf,(*testing.common).Log,(*testing.common).Logf,(*testing.common).Skip,(*testing.common).Skipf,(testing.TB).Error,(testing.TB).Errorf,(testing.TB).Fatal,(testing.TB).Fatalf,(testing.TB).Log,(testing.TB).Logf,(testing.TB).Skip,(testing.TB).Skipf,fmt.Errorf,fmt.Fprint,fmt.Fprintf,fmt.Fprintln,fmt.Print,fmt.Printf,fmt.Println,fmt.Sprint,fmt.Sprintf,fmt.Sprintln,log.Fatal,log.Fatalf,log.Fatalln,log.Panic,log.Panicf,log.Panicln,log.Print,log.Printf,log.Println,runtime/trace.Logf)
       enable shift analysis
       enable stdmethods analysis
       enable structtag analysis
    -tags string
       space-separated list of build tags to apply when parsing
       enable tests analysis
       enable unmarshal analysis
       enable unreachable analysis
       enable unsafeptr analysis
       enable unusedresult analysis
    -unusedresult.funcs value
       comma-separated list of functions whose results must be used (default errors.New,fmt.Errorf,fmt.Sprint,fmt.Sprintf,sort.Reverse)
    -unusedresult.stringmethods value
       comma-separated list of names of methods of type func() string whose results must be used (default Error,String)
  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • incremental:


    Note: The incremental analysis cannot be supported for go tool vet. This is because go tool vet requires buildable packages to work and the results on unchanged files can be affected by changed files.

  • experimental:

    No tool specific experimental options are available.

YAML Examples

  • With default options:

         go-vet: default
  • With custom machine:

           cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

           options: [-printf, -shadow]

Resolving Dependencies

go vet requires all build dependencies to run, so Inspecode resolves the dependencies in the same manner as the go test's case. See the go test page for the details.

results matching ""

    No results matching ""