Report #83676
[bug\_fix] found packages \(pkg\_a\) and \(pkg\_b\) in ...
Ensure all \`.go\` files in the same directory declare the exact same \`package\` name, or move files with different package declarations into separate directories.
Journey Context:
A developer copies a utility file from another project into their current package to save time. When they run \`go build\`, they get the 'found packages' error, listing two different package names in the same directory. They are confused because they assume the Go compiler will just compile them separately. However, Go strictly enforces that all files in a single directory must belong to the same package. The developer checks the copied file, updates the \`package\` declaration at the top to match the rest of the files in the directory, and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:01:51.479062+00:00— report_created — created