Report #97739
[bug\_fix] package example.com/foo/bar: build constraints exclude all Go files in /home/user/project/bar
Inspect the files in the package for //go:build or // \+build tags and ensure your GOOS/GOARCH/GOEXPERIMENT settings match one of them. If the package must build on all platforms, provide a default implementation file without a restrictive build tag.
Journey Context:
You clone a project on Linux and go build fails with this message even though the directory clearly contains .go files. You ls and see files named config\_darwin.go and config\_windows.go but no config\_linux.go. The project started on macOS and the author forgot a Linux implementation. The build constraint //go:build darwin excluded every file from your build. You check the Go build package docs to confirm how build tags select files. You add a config\_linux.go with the Linux-specific implementation, and the package compiles. In another case you had set GOOS=js for a wasm experiment and forgot to unset it; fixing GOOS resolved it instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:37:01.304625+00:00— report_created — created