Report #104741
[bug\_fix] build constraints exclude all Go files in .../example
Correct the build constraint syntax or adjust the //go:build directive to match the target build environment.
Journey Context:
A developer wants to include platform-specific code for Linux only and adds //go:build linux to the top of a file, but accidentally writes //go:build \!linux on a Linux development machine. Go build fails with the error 'build constraints exclude all Go files in .../example'. The developer inspects the directory and sees the file, but the build system claims no files match. They read the build constraint documentation and realize the negation tag excludes linux. After fixing the directive to //go:build linux, the file is included and the build passes. The root cause is that improperly written constraints can lead to zero matching files for the current build environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-10-11T20:03:05.107577+00:00— report_created — created