{"record":{"id":"fa3d522555d525bd","repo":"golang/go","slug":"s-v-fa3d52","errorCode":null,"errorMessage":"%s: %v","messagePattern":"%s: %v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/work/exec.go","lineNumber":177,"sourceCode":"\t\tif a.json != nil {\n\t\t\ta.json.TimeDone = time.Now()\n\t\t}\n\n\t\t// The actions run in parallel but all the updates to the\n\t\t// shared work state are serialized through b.exec.\n\t\tb.exec.Lock()\n\t\tdefer b.exec.Unlock()\n\n\t\tif err != nil {\n\t\t\tif b.AllowErrors && a.Package != nil {\n\t\t\t\tif a.Package.Error == nil {\n\t\t\t\t\ta.Package.Error = &load.PackageError{Err: err}\n\t\t\t\t\ta.Package.Incomplete = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif a.Package != nil {\n\t\t\t\t\tif ipe, ok := errors.AsType[load.ImportPathError](err); !ok || ipe.ImportPath() != a.Package.ImportPath {\n\t\t\t\t\t\terr = fmt.Errorf(\"%s: %v\", a.Package.ImportPath, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsh := b.Shell(a)\n\t\t\t\tsh.Errorf(\"%s\", err)\n\t\t\t}\n\t\t\tif a.Failed == nil {\n\t\t\t\ta.Failed = a\n\t\t\t}\n\t\t}\n\n\t\tfor _, a0 := range a.triggers {\n\t\t\tif a.Failed != nil {\n\t\t\t\tif a0.Mode == \"test barrier\" {\n\t\t\t\t\t// If this action was triggered by a test, there\n\t\t\t\t\t// will be a test barrier action in between the test\n\t\t\t\t\t// and the true trigger. But there will be other\n\t\t\t\t\t// triggers that are other barriers that are waiting\n\t\t\t\t\t// for this one. Propagate the failure to the true","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/work/exec.go#L159-L195","documentation":"In the generic action-completion path of Builder.do, when an action's Actor.Act returned an error and AllowErrors is false, the error is re-wrapped with the package ImportPath (unless it already carries that path via an ImportPathError). This produces the familiar 'example.com/pkg: <underlying error>' message in build output.","triggerScenarios":"Any failed package-level build action whose error doesn't already identify its package. This is the outer wrapper — the inner error is the real cause (compile error, missing dep, tool failure). It is not itself the root cause; it adds package context.","commonSituations":"A compile error in a dependency; a missing import; a tool invocation failure during build; any error that bubbles up through the action executor for a Package action.","solutions":["Read the wrapped message after the colon — that's the real error to fix.","Fix the underlying compile/link/dependency error in the named package.","Use 'go build -x' for full command tracing if the inner error is unclear.","If AllowErrors is desired (continue past failures), use 'go build ./...' which sets it for multi-package runs."],"exampleFix":"// before\n$ go build ./...\n// example.com/pkg/internal/foo: undefined: foobar\n\n// after — fix the underlying error in the named package\n// edit pkg/internal/foo/foo.go: rename or define 'foobar'\n$ go build ./...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// This is a wrapper; surface the inner error to the user/CI log.\nif perr, ok := err.(*load.PackageError); ok {\n    log.Printf(\"build failed for %s: %v\", perr.ImportStack, perr.Err)\n} else {\n    log.Printf(\"build failed: %v\", err)\n}","preventionTips":["Always read the text after the colon — it's the real cause.","Use 'go build ./...' to gather all package errors in one pass (AllowErrors path).","Reproduce a single package failure with 'go build <that import path>'."],"tags":["build","error-wrapping","packaging"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}