Documentation
¶
Index ¶
- func Write(w io.Writer, format OutputFormat, headers []string, rows [][]string, ...) error
- func WriteCSV(w io.Writer, headers []string, rows [][]string) error
- func WriteJSON(w io.Writer, v interface{}) error
- func WriteTSV(w io.Writer, headers []string, rows [][]string) error
- func WriteTable(w io.Writer, headers []string, rows [][]string) error
- type OutputFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
func Write(w io.Writer, format OutputFormat, headers []string, rows [][]string, jsonVal interface{}) error
Write writes tabular data using the specified output format.
Types ¶
type OutputFormat ¶
type OutputFormat string
OutputFormat specifies the desired output format.
const ( FormatTable OutputFormat = "table" FormatJSON OutputFormat = "json" FormatCSV OutputFormat = "csv" FormatTSV OutputFormat = "tsv" )
func ParseFormat ¶
func ParseFormat(s string) (OutputFormat, error)
ParseFormat parses the output format string.
Click to show internal directories.
Click to hide internal directories.