Report #64661
[bug\_fix] build constraints exclude all Go files
Add a Go file to the package without build constraints, or add a file with build constraints matching the target OS/Architecture \(e.g., \`//go:build windows\` if building on Windows\).
Journey Context:
A developer is writing a cross-platform package and creates \`process\_linux.go\` and \`process\_darwin.go\`, each with \`//go:build linux\` and \`//go:build darwin\` respectively. When they run \`go vet ./...\` or build on a Windows machine, the toolchain fails with this error. They might think the build tags are broken or the compiler is ignoring their files. The real issue is that the Go compiler needs at least one file in the package to establish the package clause and imports, even if the implementation is empty. Because every file in the directory has a build constraint that excludes Windows, the compiler sees an empty package. The fix is to add a stub file \(like \`process\_windows.go\`\) or a shared file without OS-specific build tags so the package can be compiled on all platforms.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T15:01:04.965213+00:00— report_created — created