go-stdlib-methods.ts lists the methods of 130 standard-library types with
their parameter and result counts. Its generator lived in a validation kit.
scripts/gen-go-stdlib-methods.mjs reads a Go source tree with the engine's
Go grammar, counts with the engine's own goSignatureArity, and prints (or
--write's) the table for the types it lists, so a later Go release's
methods are one command away. Against go1.27.3 it reproduces the table byte
for byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goImplementsEdges (#584) follows declared embeddings since #2402, but an
embedding of a type outside the index resolves to nothing, so it added no
methods: prometheus's TBRun (testing.TB plus Run) went to a struct with only
a Run, QueryLogger (slog.Handler plus io.Closer) had no implementations,
kapacitor's Diagnostic (a third-party Logger plus Log) took every struct with
a Log, and the predeclared `error` was not recorded at all.
- go-stdlib-methods.ts lists the methods of 130 standard-library types, each
as `name:params/results`, generated from go1.27.3's source and counted the
way goSignatureArity counts a stored signature.
- Both extractors record an embedded `error`, which stays unresolved. The
predeclared-type set is unchanged, so alias and defined-type references
still skip it.
- goImplementsEdges reads each Go type's failed `extends` rows and reads the
package back off the line (goRefQualification, now exported). A
standard-library type's methods join the method set, keyed as goMethodKey
keys the project's (`std:<import path>` for an unexported one), and the
arity gate holds them to the table's counts on both sides: a `sync.Mutex`
makes a struct hugo's `Locker`, not etcd's gRPC `LockClient`. Any other
outside type is met by a type embedding the same one, or by the only type
with every other method the interface names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>