Documentation ¶
Overview ¶
Package list provides a utility function to quickly print a table based on the element fields of a slice. This package is currently used for franz - while it can, in theory, be used for other packages, there are still various edge cases that should be taken care of, such as passing in something different than a slice or a slice of interface{}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTable ¶
FormatTable takes a slice with a distinct type as argument and prints it as a table, one row for for each entry in the slice. The columns are based on the statically declared element type of the slice, so note that passing in e.g. []interface{} does not make much sense. By default, the field name is taken as the column name. This can be overridden by setting a tag like so: `header:"New Column Name"`.
Types ¶
This section is empty.