{"record":{"id":"bb5ac9b5665dcabf","repo":"golang/go","slug":"vet-config-not-found","errorCode":null,"errorMessage":"vet config not found","messagePattern":"vet config not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/work/exec.go","lineNumber":1583,"sourceCode":"// -{vet,fix}tool) were set explicitly on the command line.\nvar VetExplicit bool\n\nfunc (b *Builder) vet(ctx context.Context, a *Action) error {\n\t// a.Deps[0] is the build of the package being vetted.\n\n\ta.Failed = nil // vet of dependency may have failed but we can still succeed\n\n\tif a.Deps[0].Failed != nil {\n\t\t// The build of the package has failed. Skip vet check.\n\t\t// Vet could return export data for non-typecheck errors,\n\t\t// but we ignore it because the package cannot be compiled.\n\t\treturn nil\n\t}\n\n\tvcfg := a.Deps[0].vetCfg\n\tif vcfg == nil {\n\t\t// Vet config should only be missing if the build failed.\n\t\treturn fmt.Errorf(\"vet config not found\")\n\t}\n\n\tsh := b.Shell(a)\n\n\t// We use \"vet\" terminology even when building action graphs for go fix.\n\tvcfg.VetxOnly = a.VetxOnly\n\tvcfg.VetxOutput = a.Objdir + \"vet.out\"\n\tvcfg.Stdout = a.Objdir + \"vet.stdout\"\n\tif a.needFix {\n\t\tvcfg.FixArchive = a.Objdir + \"vet.fix.zip\"\n\t}\n\tvcfg.PackageVetx = make(map[string]string)\n\n\th := cache.NewHash(\"vet \" + a.Package.ImportPath)\n\tfmt.Fprintf(h, \"vet %q\\n\", b.toolID(\"vet\"))\n\n\tvetFlags := VetFlags\n","sourceCodeStart":1565,"sourceCodeEnd":1601,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/work/exec.go#L1565-L1601","documentation":"When vetting a package, the go tool reads a.Deps[0].vetCfg, the vet configuration produced by the package's build action. If the build did not fail (a.Deps[0].Failed == nil) yet vetCfg is nil, this fires. The accompanying comment states vet config should only be missing when the build failed, so reaching this branch implies an internal inconsistency in action-graph construction.","triggerScenarios":"Fires in the vet action builder after the `if a.Deps[0].Failed != nil` early return, when a.Deps[0].vetCfg == nil.","commonSituations":"Internal toolchain bug, or unusual packages (assembly-only, packages with no Go files) where vet config is not produced. Very rare in normal use.","solutions":["Run `go vet -x <pkg>` to trace action execution","Run `go build <pkg>` separately to confirm the build itself succeeds","Report as a Go bug with the package path and build flags"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Build the package first to surface the real failure before vet\nif err := exec.Command(\"go\", \"build\", pkg).Run(); err != nil {\n    return err // build failure is the root cause\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run `go build` before `go vet` so build errors surface first","Keep the Go toolchain current to benefit from action-graph fixes","Report persistent occurrences with `go vet -x` output"],"tags":["go-toolchain","vet","internal-error","build-action-graph"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}