feat: add go ecosystem support to generate lockfile (Fixes #28) - #33
Open
anant-shipit wants to merge 1 commit into
Open
feat: add go ecosystem support to generate lockfile (Fixes #28)#33anant-shipit wants to merge 1 commit into
anant-shipit wants to merge 1 commit into
Conversation
…outcode-org#28) Signed-off-by: anant-shipit <anantsinghrathore97@gmail.com>
anant-shipit
force-pushed
the
feat/issue-28-go-lockfile
branch
from
July 20, 2026 18:49
9153b20 to
51c2202
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.
Fixes #28
Description
This PR adds support for generating an accurate Go "lockfile" (
go.list.json) using thedeplockCLI tool.As noted in the issue,
go.modandgo.sumdo not always tell the complete story of the exact dependencies used during a build (for example, they often hide deep transitive dependencies).To resolve this and get the most accurate details, the new
deplock go [path]command leverages thego list -m -json allcommand, which outputs the fully resolved build graph.Implementation Details
cmd/go.goto handle the Go ecosystem.go list -m -json allnatively outputs a stream of Newline-Delimited JSON (NDJSON) rather than a valid JSON array. The command intercepts this raw stdout stream, parses the NDJSON, and wraps it in standard brackets to output a strictly valid JSON Array togo.list.json.goCmdinto the global ecosystems array incmd/root.go.Verification
deplock go .on thedependency-inspectorproject itself.go.list.jsonis generated successfully and passes strict JSON validation.go.modfile.