Skip to content

Add a go.mod lockfile parser (Go) #6

Description

@AshwinUgale

Why

Same motivation as the Cargo issue (#5) - Go is named in the README roadmap. go.mod is a simple line-oriented format, so this is a self-contained parser.

What to do

  • Add parse_go_mod(path) to sidecar/src/docchat_sidecar/lockfiles.py. Parse require lines, both the single form require github.com/foo/bar v1.2.3 and the block form require ( ... ).
  • The module path is the "library". Decide whether to keep or strip the leading v in the version (e.g. v1.2.3 -> 1.2.3) and document the choice in the docstring.
  • Decide how to treat // indirect deps and document it. Return list[Pin].

Acceptance criteria

  • Tests covering single require, block require, indirect deps, and missing/malformed files.
  • Full sidecar check pipeline green.

Pointers

  • Mirror parse_requirements_txt for the line-oriented parsing style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterNew format/source adapter (lockfile or doc source)enhancementNew feature or requestgood first issueGood for newcomerspythonPython sidecar

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions