godoc

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package godoc extracts documentation text from Go doc comments so host-side analysis can carry it into generated artifacts such as OpenAPI descriptions.

Doc text is kept verbatim (comment markers removed): the Go source is the single source of truth, so no rewording or prefix trimming happens here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deprecated

func Deprecated(doc string) bool

Deprecated reports whether doc carries a godoc "Deprecated:" paragraph.

func Split

func Split(doc string) (summary, description string)

Split separates doc into its first sentence and the remaining text. The first sentence maps to an OpenAPI summary, the remainder to a description. Either result may be empty.

func Text

func Text(groups ...*ast.CommentGroup) string

Text returns the plain text of the first non-empty comment group. Nil groups are skipped, so callers can pass fallbacks in priority order (for example a TypeSpec doc followed by its GenDecl doc).

Types

This section is empty.

Jump to

Keyboard shortcuts

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