Report #3165
[bug\_fix] build constraints exclude all Go files in /path/to/pkg
Build or test with the matching tag, e.g. "go test -tags=integration ./...", or edit the //go:build line so the default GOOS/GOARCH/tags satisfy the constraint.
Journey Context:
I added a new package for database integration tests and put "//go:build integration" at the top of every file. Running "go test ./..." failed with "build constraints exclude all Go files in ./storetest". I thought the files were simply missing until I noticed the build tag. By default the go command considers only files whose build constraints match the current build context, and integration was not a satisfied tag. I could have removed the tag, but then the tests would run on every "go test" and require a live database. The correct fix was to keep the tag and run integration tests explicitly with "go test -tags=integration ./...". This lets the package compile only when intended and keeps normal unit tests fast and offline.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T15:36:46.205515+00:00— report_created — created