Report #22969
[bug\_fix] package embed is not in GOROOT \(/usr/local/go/src/embed\)
Update the Go toolchain version used to build the project to a version that includes the standard library package \(e.g., Go 1.16\+ for the \`embed\` package\).
Journey Context:
A developer writes a new service using the \`embed\` package to bundle static files. They push the code to their CI/CD pipeline, and the build fails with 'package embed is not in GOROOT'. Locally, it works perfectly. The developer goes down a rabbit hole checking their \`GOPATH\`, \`GOROOT\`, and CI environment variables, assuming the Go installation on the CI server is misconfigured or missing standard library files. They might even try to manually copy the \`embed\` package into the CI server's GOROOT. The actual root cause is that the CI pipeline is using an older Go version \(e.g., Go 1.15\) that predates the \`embed\` package \(introduced in Go 1.16\). The Go toolchain looks for standard library packages strictly in the \`GOROOT\` of the currently executing Go version. The fix works because updating the CI Go version to 1.16\+ provides the \`embed\` package in the standard library.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:58:01.036463+00:00— report_created — created