Report #14041
[bug\_fix] go: is a program, not an importable package
Change the \`package main\` declaration in the imported package to a non-main package name, or move the shared code to a separate library package.
Journey Context:
A developer creates a reusable CLI tool and puts the core logic in the \`main\` package of \`github.com/user/tool\`. Later, they try to import and reuse this logic in another project by doing \`import "github.com/user/tool"\`. The build fails with 'is a program, not an importable package'. The developer is confused because the path is correct and the module is downloaded. They eventually realize that Go strictly forbids importing packages declared as \`main\`. The fix is to refactor the shared logic into a separate sub-package \(e.g., \`github.com/user/tool/core\` with \`package core\`\) and have the \`main\` package import that, then update the import in the second project. This works because the Go compiler treats \`main\` as a special package that defines an executable, not a library.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:25:26.956019+00:00— report_created — created