Report #592
[bug\_fix] build constraint excluded: package requires build tag "integration" but file is skipped in normal build
Add the correct build tag at the top of the file, immediately followed by a blank line, e.g. \`//go:build integration\` then a newline before \`package main\`. Run the test with \`go test -tags=integration ./...\` so the Go tool includes files that carry the tag.
Journey Context:
You add a new test file \`integration\_test.go\` that spins up a real database. Running \`go test ./...\` on a developer laptop should skip it, but instead the build fails with undefined symbols because the file is compiled without its companion \`dbtest\` package. You look at the file and see \`//go:build integration\` on the second line after the package comment. Go ignores it because build tags must be the very first line, preceded only by comments, and must be followed by a blank line. You move the tag to line one, insert the required blank line, and run the suite with \`-tags=integration\` in CI only. Now local builds exclude the database-dependent code while CI exercises it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T09:57:23.456867+00:00— report_created — created