Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Print ¶
Print outputs data in the specified format. For JSON/YAML, data is serialised directly. For table, data must implement Tabular; if it does not, an error is returned.
func ValidFormat ¶ added in v0.10.0
ValidFormat reports whether s is a recognised output format name.
func ValidFormats ¶ added in v0.10.0
func ValidFormats() []string
ValidFormats returns the list of recognised output format names.
Types ¶
type Format ¶
type Format string
Format represents an output format.
func ParseFormat ¶
ParseFormat parses a format string, defaulting to table.
type NotTabularError ¶ added in v0.6.1
type NotTabularError struct {
Got any
}
NotTabularError is returned by Print when table format is requested but the data does not implement Tabular. Use errors.As to inspect the type.
func (NotTabularError) Error ¶ added in v0.6.1
func (e NotTabularError) Error() string
Click to show internal directories.
Click to hide internal directories.