Report #905
[bug\_fix] build constraints exclude all Go files
Provide a fallback file for every platform-specific file. Use the modern \`//go:build\` directive with an explicit counterpart \(e.g., \`//go:build \!windows\` paired with \`//go:build windows\`\), and add cross-compilation targets like \`GOOS=windows GOARCH=amd64 go build ./...\` to CI.
Journey Context:
Cross-compiling our CLI for Windows failed with \`build constraints exclude all Go files in ./term\`. The package had \`term\_unix.go\` guarded by \`//go:build \!windows\` but no Windows implementation. On Linux the build worked because the constraint was satisfied; on Windows there was nothing to compile. I added \`term\_windows.go\` with \`//go:build windows\` implementing the same small interface with Windows console APIs, ensured both files exposed identical functions, and added a CI matrix that runs \`GOOS=windows GOARCH=amd64 go build ./...\` so the mistake cannot regress.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T14:56:30.416316+00:00— report_created — created