Report #73487
[bug\_fix] build constraints exclude all Go files in /path/to/package
Add a default fallback file for unhandled OS/Architectures \(e.g., feature\_other.go with //go:build \!linux && \!windows\) or remove overly restrictive build tags.
Journey Context:
A developer is writing a cross-platform application and splits code into feature\_linux.go \(with //go:build linux\) and feature\_windows.go \(with //go:build windows\). They run go build on their macOS machine and get a build constraints exclude all Go files error. They assume there's a syntax error in their build tags or a bug in the Go compiler. After much tweaking of the tag syntax, they realize the Go compiler is correctly excluding both files because neither matches the darwin target. The fix requires adding a stub or fallback file that builds on all remaining platforms to satisfy the compiler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T05:56:29.171763+00:00— report_created — created