output

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTTY

func IsTTY(f *os.File) bool

func PrintBody

func PrintBody(w io.Writer, body []byte, f Format) error

func PrintError

func PrintError(stderr io.Writer, err error, f Format)

func PrintJSON added in v0.1.3

func PrintJSON(w io.Writer, v any) error

func WantsJSON added in v0.1.3

func WantsJSON(jsonFlag bool, stdout *os.File) bool

Types

type Format

type Format int
const (
	Human Format = iota
	JSON
)

func ResolveErrorFormat added in v0.1.3

func ResolveErrorFormat(jsonFlag bool, stderr *os.File) Format

func ResolveFormat

func ResolveFormat(jsonFlag, isTTY bool) Format

Jump to

Keyboard shortcuts

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