feat: add Go modules (go.mod) support - #18
Draft
algomaster99 wants to merge 2 commits into
Draft
Conversation
Adds pkg/golang, a checker for go.mod's require entries (single-line and block form, direct and indirect), following the pattern established for Maven/npm/PyPI/GitHub Actions. Unlike those manifests, go.mod has no range syntax, so every require entry is already an exact pin - pins.ExactVersion is only used to reject malformed lines, not to filter loose specifiers. The package doc comment covers the Go-specific gotchas: pseudo-versions compare as older than any tagged release (semver prerelease precedence), "+incompatible" is ignored as build metadata, go.mod's version is a minimum under MVS rather than what's actually built, and `replace` directives aren't visible to git-pkgs/manifests' parser. Wires golang.Checker into main.go's checker registry, updates the supported-manifests lists in README.md/CLAUDE.md, and adds go-01..05 cases to benchmark/cases.json.
Covers the gap flagged in review: yul's resolver only has release-tag metadata, so a deliberate pseudo-version pin (picking up an unreleased fix) always compares older than the latest tag and gets flagged/blocked - there's no way for it to instead suggest a newer pseudo-version the way `go get`/Renovate's digest tracking would. This case exercises that scenario for manual benchmarking.
algomaster99
force-pushed
the
claude/golang-feature-manifests-piztaq
branch
from
August 17, 2026 04:25
a235310 to
99cf66b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yulnow checksgo.mod(#4):pkg/golangparsesrequireentries viagit-pkgs/manifestsand flags any newly added/changed one pinned older than the latest release, same as the existing Maven/npm/PyPI/GitHub Actions checkers. Unlike those manifests,go.mod'srequiresyntax has no ranges/operators at all — every entry is already an exactmodule versionpair, so there's no bare-vs-range disambiguation to do.Before (Claude writes a stale exact pin, nothing catches it):
After:
(exit 2, write blocked — Claude sees the correct version on stderr and retries)
Known gap, left for a follow-up: a module pinned to a pseudo-version (
v0.0.0-<timestamp>-<hash>, Go's format for an untagged commit) always compares as older than any tagged release and gets flagged, even when the pin is deliberate (e.g. picking up an unreleased fix).go get/Renovate handle this by falling back to digest-tracking — resolving the module's latest commit and suggesting a newer pseudo-version instead of a tag — but that needs a resolver capability (VCS tip lookup)git-pkgs/enrichmentdoesn't currently expose, so it's out of scope here.go-06-pseudo-version-unreleased-fixinbenchmark/cases.jsonexercises this scenario.Changes
pkg/golang/gomod.go(new):Checkerforgo.mod. A few Go-specific cases needed a design pass — given:+incompatiblecases are exercised in the tests below; thereplacegap is a known parser limitation, same category as e.g. Maven's<parent>version-as-property.pkg/golang/gomod_test.go(new): parsing (single-line/blockrequire, indirect,replaceignored), fresh pin below/at latest, untouched-pin skip, pseudo-version and+incompatiblecases.main.go/main_test.go: wiregolang.Checkerinto the checker registry; fix a test that assertedgo.modwas unknown (nowCargo.toml, which still is).README.md/CLAUDE.md: addgo.modto the supported-manifests list.benchmark/cases.json:go-01..06cases (resty/cobra/zap/uuid fresh, testify existing, pseudo-version-pin fresh).