Repository navigation
Migrate Go tools to modules; add Go build/vet/test CI - #8
Merged
Merged
Conversation
The three Go tools were built with `dep` (Gopkg.toml/lock) and had no
go.mod, so `go build`/`go test` could not run in modules mode. This
migrates each to its own module (matching their "cd + go install"
workflow) and wires them into the PR CI added earlier.
- gomod-doccopy: stdlib only (go 1.23).
- hack-vendor: covers both cmd/ tools; requires BurntSushi/toml (go 1.23).
- govendor-override: requires the archived github.com/golang/dep v0.5.0.
dep's gps package needs the old Masterminds/semver API, so semver is
pinned to the revision dep vendored (v0.0.0-20180403...24642bd); every
other dep rides current versions. This pulls in golang.org/x/sync,
which sets the module's floor at go 1.25.0.
Removes the now-obsolete govendor-override/Gopkg.{toml,lock}. The
testdata/*.template.toml files are test fixtures and are kept.
Adds a `go` matrix job to .github/workflows/ci.yml that runs
build/vet/test per module on Go 1.25 (satisfies all three). `go build`
runs -mod=readonly by default, so it fails on a stale/incomplete go.mod.
Verified locally: build, vet, and test pass for all three modules
(no test files yet -> tests pass trivially; unit tests are a follow-up).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Migrates the three Go tools from
dep(Gopkg.toml/lock) to Go modules sogo build/go vet/go testcan run, and adds a Go job to the PR CI. This unblocks the Go unit-testing follow-up from the earlier CI PR.Modules
gofloorgomod-doccopyhack-vendor(bothcmd/tools)github.com/BurntSushi/toml v1.6.0govendor-overridegithub.com/golang/dep v0.5.0(+ transitive)Each tool is its own module, matching the "cd +
go install" workflow in the READMEs and isolating dep's heavy tree.The tricky part —
govendor-overridedep'sgpspackage compiles only against the oldMasterminds/semverAPI (NewConstraintIC,IsNone, value-typeVersion). Modules resolved semver to v1.5.0, which broke the build. Fix: pin semver to the exact revisiondep v0.5.0vendored (v0.0.0-20180403015459-24642bd05731) — the one essential pin. Everything else rides current versions; that pulls ingolang.org/x/sync, which sets the module floor at Go 1.25.0.Cleanup
govendor-override/Gopkg.{toml,lock}.govendor-override/testdata/*.template.toml— those are the tool's test fixtures.CI
Adds a
gomatrix job (.github/workflows/ci.yml) runningbuild/vet/testper module on Go 1.25 (satisfies all three).go builddefaults to-mod=readonly, so it fails on a stale/incomplete go.mod — no mutatinggo mod tidyin CI (brittle across toolchain patches).Verification (local)
All three modules pass
go build -mod=readonly ./...,go vet ./...,go test ./.... No test files exist yet, sogo testpasses trivially — this establishes the foundation.Follow-ups
gomod-doccopypath logic;govendor-override, which already shipstestdata/).🤖 Generated with Claude Code