Report #101980
[bug\_fix] undefined: LoadConfig \(or \`? example.com/foo \[no test files\]\` despite \`foo\_linux\_test.go\`\)
Provide a portable implementation file without a restrictive build tag, or set the correct OS/arch constraint for the target platform. Ensure \`//go:build\` is followed by a blank line before the \`package\` clause.
Journey Context:
You add \`config\_linux.go\` and \`config\_windows.go\` to a cross-platform project. On your macOS laptop, \`go build\` fails with \`undefined: LoadConfig\` even though the file clearly exists. You double-check imports and realize the Linux file starts with \`//go:build linux\`, so the Go toolchain excludes it from the macOS build. Build constraints are silently applied at the file level based on \`GOOS\`/\`GOARCH\`. You add a \`config\_default.go\` \(or \`config\_unix.go\`\) without a restrictive tag, fix the blank line after the constraint, and the project builds on both macOS and Linux CI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:46:26.571268+00:00— report_created — created