generate

package
v0.0.0-...-40bd187 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 16 Imported by: 2

Documentation

Overview

Package generate provides a generator to generate go code from go docs that registers doc entries for use with the docreflect package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRegistry

func GenerateRegistry(o Options, w io.Writer, outputPackageName string, gopath ...string) error

GenerateRegistry generates a Go code file to the output, including a package init function that will register the documentation of the declarations specified by their gopath.

The gopath argument accepts any number of package, package level symbol, or struct field paths. It is recommended to use package paths unless special circumstances.

Some important gotchas to keep in mind, GenerateRegistry does not resolve type references like type aliases, or type definitions based on named types, and it doesn't follow import paths.

Types

type Options

type Options struct {

	// Main indicates that the docs for the symbols will be lookded up as part of the main package of an
	// executable.
	Main bool
}

Options contains options for the generator.

Jump to

Keyboard shortcuts

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