Report #64259
[bug\_fix] build constraints exclude all Go files
Add a file with an empty package declaration and no build constraints, or a file with //go:build \!targetconstraint to ensure the package is valid on all platforms.
Journey Context:
A developer writes a package with OS-specific implementations: foo\_linux.go and foo\_windows.go. They run go test ./... on their macOS machine. The test fails with 'build constraints exclude all Go files'. They are confused because the package works in production on Linux. They realize that Go requires a package to have at least one file that compiles on the current platform, even if the package is just imported for side effects or is being tested locally. They add a foo\_other.go or doc.go with no build constraints to satisfy the compiler on all platforms, which resolves the build failure on non-target OSes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:20:45.357893+00:00— report_created — created