Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OutputFormatter ¶
type OutputFormatter func(object interface{}) string
OutputFormatter declares the function signature for formatting output
var ConsoleOutputFormatter OutputFormatter
ConsoleOutputFormatter determines how output data will be formatted A nil value will print human readable output, all other values will print computer output
var JSONFormatter OutputFormatter = func(object interface{}) string { buf := bytes.Buffer{} jsonEncoder := json.NewEncoder(&buf) jsonEncoder.SetIndent("", " ") jsonEncoder.Encode(object) return buf.String() }
JSONFormatter formats all values as json
Click to show internal directories.
Click to hide internal directories.