go: support projects with multiple binaries when using go.mod
Metadata
Current evaluation
Merged into master after approval and passing CI. Updates Go build logic to support multiple binaries with go.mod by removing the single-binary restriction, updating relinking logic, and adjusting tests.
Suggested action: —
No scores available.
Issue body
There was a check to assert only one binary was built.
- Remove the error check. If no binaries are found, warn.
- Update logic to handle relinking multiple binaries.
- Update multiple main spread test to also build with go.mod.
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged into master after approval and passing CI. Updates Go build logic to support multiple binaries with go.mod by removing the single-binary restriction, updating relinking logic, and adjusting tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to master, enabling Go projects with multiple binaries via go.mod. Removed the single-binary assertion, updated relinking logic, and expanded tests. Codecov confirmed successful merge with minimal coverage impact. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Removes the single-binary assertion for Go projects using go.mod and updates relinking logic to support multiple binaries. Unit tests updated. Passed CI checks. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2824 Support for go.mod | snapcraft | merged | Merged after approval, adding go.mod support across seven files. Author noted potential need to restore legacy binary name deduction logic to maintain compatibility with older Go versions. |