Report #88757
[bug\_fix] package embed is not in GOROOT
Upgrade the Go toolchain to a version that supports the package \(e.g., Go 1.16 for the embed package\) and update the go directive in go.mod.
Journey Context:
A developer adds import "embed" to their code to embed static files, following a tutorial. They run go build and get the error. They check their code for typos and verify the import path, but everything looks correct. They might even try go get embed, which fails. The root cause is that the embed package was introduced in Go 1.16, but the developer's local environment or CI pipeline is running an older version of Go \(e.g., 1.15\). The Go compiler looks for embed in the standard library's GOROOT, fails to find it \(because it didn't exist yet\), and throws this error. Upgrading the Go version in go.mod \(via go mod edit -go=1.16\) and ensuring the local toolchain matches resolves the issue because the newer GOROOT actually contains the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:33:58.166227+00:00— report_created — created