Skip to content

Commit the go.sum that go mod tidy produces - #34

Merged
richhaase merged 1 commit into
mainfrom
fix/tidy-go-sum
Jul 25, 2026
Merged

Commit the go.sum that go mod tidy produces#34
richhaase merged 1 commit into
mainfrom
fix/tidy-go-sum

Conversation

@richhaase

Copy link
Copy Markdown
Owner

go.sum was assembled by go get during the port and never tidied afterwards, so it is missing the two github.com/google/go-cmp hashes that go mod tidy adds. go-cmp is a test dependency of goimports, which the repo pulls in via the tool directive in go.mod:

$ go mod why -m github.com/google/go-cmp
golang.org/x/tools/cmd/goimports
golang.org/x/tools/internal/imports
golang.org/x/tools/internal/imports.test
github.com/google/go-cmp/cmp

CI never caught it because it runs go mod verify and go mod download, both of which are satisfied by the existing file. Two consequences:

  • anyone running go mod tidy gets an unexplained two-line diff
  • .goreleaser.yaml runs go mod tidy as a before-hook, so cutting a release would have mutated go.sum mid-build

After this the tree is idempotent under its own tooling — a second go mod tidy is a no-op, go mod verify reports all modules verified, and make check passes.

My oversight from the port; found while dry-running make release-snapshot to check the release path before any tag is cut.

🤖 Generated with Claude Code

go.sum was assembled by `go get` and never tidied afterwards, so it was
missing the two go-cmp hashes that `go mod tidy` adds — go-cmp is a test
dependency of goimports, which the repo pulls in through the `tool`
directive in go.mod.

CI never noticed because it runs `go mod verify` and `go mod download`,
which are satisfied by the existing file. The visible symptom is that
anyone running `go mod tidy` gets an unexplained diff, and goreleaser's
release pipeline runs exactly that as a before-hook, so a release would
have mutated go.sum mid-build.

The tree is now idempotent under its own tooling: a second tidy is a
no-op, `go mod verify` reports all modules verified, and `make check`
passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@richhaase richhaase left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

3 of 3 reviewers found no issues.

Reviewer comments
  • Reviewer 1: The patch only adds checksums produced by go mod tidy, and go mod tidy -diff reports no remaining changes. It does not alter runtime behavior or break existing code.
    Categorized as informational during summarization
  • Reviewer 2: The patch only adds checksums produced by go mod tidy. Running go mod tidy -diff produces no further changes, and the additions do not alter runtime behavior.
    Categorized as informational during summarization
  • Reviewer 3: The patch only adds checksums produced by go mod tidy. go mod verify succeeds, and go mod tidy -diff reports no remaining differences.
    Categorized as informational during summarization

Posted by acr 0.20.4

@richhaase
richhaase merged commit 0208762 into main Jul 25, 2026
8 checks passed
@richhaase
richhaase deleted the fix/tidy-go-sum branch July 25, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant