print

package
v0.14.68 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package print provides JSON, YAML, table, and text printers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, value any)

JSON prints value to out

func Map

func Map(w io.Writer, header []string, vals map[string]string)

Map prints map

func Object

func Object(w io.Writer, format string, value any)

Object prints value to out in format

func Print

func Print(w io.Writer, value any)

Print value

func RegisterType

func RegisterType(typ any, printFunc func(io.Writer, any))

RegisterType allows registering a custom print function for a specific type.

func Strings

func Strings(w io.Writer, res []string)

Strings prints strings

func Text added in v0.12.55

func Text(w io.Writer, doc string, indent string, noFirstIndent bool)

Text prints text with indentation, keeping the first line without indentation if noFirstIndent is true

func TextOneLine added in v0.12.55

func TextOneLine(w io.Writer, doc string)

TextOneLine prints documentation text in one line

func Yaml

func Yaml(w io.Writer, value any)

Yaml prints value to out

Types

type Printer

type Printer interface {
	Print(w io.Writer)
}

Jump to

Keyboard shortcuts

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