Documentation
¶
Overview ¶
Package print provides JSON, YAML, table, and text printers.
Index ¶
- func JSON(w io.Writer, value any)
- func Map(w io.Writer, header []string, vals map[string]string)
- func Object(w io.Writer, format string, value any)
- func Print(w io.Writer, value any)
- func RegisterType(typ any, printFunc CustomFn)
- func Strings(w io.Writer, res []string)
- func Text(w io.Writer, doc string, indent string, noFirstIndent bool)
- func TextOneLine(w io.Writer, doc string)
- func Yaml(w io.Writer, value any)
- type CustomFn
- type Printer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterType ¶
RegisterType allows registering a custom print function for a specific type.
func Text ¶ added in v0.12.55
Text prints text with indentation, keeping the first line without indentation if noFirstIndent is true
func TextOneLine ¶ added in v0.12.55
TextOneLine prints documentation text in one line
Types ¶
type CustomFn ¶ added in v0.15.78
CustomFn is a custom print function for a specific type. It takes precedence over the default print functions.
func FindRegistered ¶ added in v0.15.78
FindRegistered finds a custom print function for a specific value.
Click to show internal directories.
Click to hide internal directories.