docgen

Guides

Show a go.mod value

Put the Go version, the toolchain or the module path in a sentence.

v2/go.mod

module github.com/USA-RedDragon/docgen/v2

go 1.24.0

cmd/tool/go.mod

module example.com/tool

go 1.24.0

toolchain go1.24.1

docs/machines/guide-gomod-lines.md

Before
- Module: <!-- docgen:gomod field=module --><!-- /docgen:gomod -->
- Go: <!-- docgen:gomod field=go --><!-- /docgen:gomod -->
- Module of the tool: <!-- docgen:gomod field=module file=cmd/tool/go.mod --><!-- /docgen:gomod -->
- Toolchain of the tool: <!-- docgen:gomod field=toolchain file=cmd/tool/go.mod --><!-- /docgen:gomod -->
After
- Module: <!-- docgen:gomod field=module -->`github.com/USA-RedDragon/docgen/v2`<!-- /docgen:gomod -->
- Go: <!-- docgen:gomod field=go -->`1.24.0`<!-- /docgen:gomod -->
- Module of the tool: <!-- docgen:gomod field=module file=cmd/tool/go.mod -->`example.com/tool`<!-- /docgen:gomod -->
- Toolchain of the tool: <!-- docgen:gomod field=toolchain file=cmd/tool/go.mod -->`go1.24.1`<!-- /docgen:gomod -->
Preview
  • Module: github.com/USA-RedDragon/docgen/v2
  • Go: 1.24.0
  • Module of the tool: example.com/tool
  • Toolchain of the tool: go1.24.1

field= is go, toolchain or module. file= reads another go.mod. With code=false, the value has no backticks, such as 1.24.0.

For details, see docgen:gomod.

Source: docs/guides/gomod.md