Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Print ¶
Print writes data in the requested format to w. For table and CSV, data must be a slice; single objects can be wrapped in a one-element slice. If table or CSV is requested but no columns are defined (e.g. for free-form map[string]interface{} responses), Print falls back to JSON so the user sees something useful rather than a blank screen.
Types ¶
type Column ¶
Column describes one column of a table/CSV. Field is the Go struct field name (case-insensitive match).
type Format ¶
type Format string
Format identifies an output format.
func DetectFormat ¶
DetectFormat returns the format to use given the value of an --output flag. If the flag is non-empty it wins. Otherwise we pick `table` for TTYs and `json` for non-TTY output (pipes, files).