genstdlib

command
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Command genstdlib walks the local Go toolchain's GOROOT/src and emits libraries_sources.yaml entries for every importable Go stdlib package. One lib_id per package (e.g. /golang/go/encoding/json), description = first-sentence synopsis + alphabetical "Key APIs:" list of the top exported names so search_libraries embeds rich enough text to discriminate between packages.

Run via:

just gen-stdlib                                  # writes to stdout
just gen-stdlib > /tmp/stdlib.yaml               # capture
mise exec -- go run scripts/genstdlib/main.go    # without justfile

The output is meant to be spliced into libraries_sources.yaml under the "── kind: godoc ──" section. Re-run on a Go version bump (the ref embedded in each entry comes from runtime.Version()).

Skipped paths (not part of the user-facing stdlib):

  • cmd/ Go toolchain (compile, link, go build, …)
  • internal/ anywhere — Go convention for non-importable code
  • vendor/ vendored deps
  • builtin/ pseudo-package, no real source
  • testdata/ test fixtures (defensive — none should land in src/)

Description shape (per package):

"<doc.Synopsis>. Key APIs: A, B, C, D, E, F, G, H."

where Key APIs is alphabetical, types first, funcs after, capped at 8 total so the description stays embeddable without dwarfing the synopsis.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL