Documentation ¶
Overview ¶
tbl.go provides some utility functions to move string one and two demensional slices into/out of one and two deminsional slices. it is used by the dsv1 module to support migrating legacy implementations of dataset.
Index ¶
- func RowInterfaceToString(r []interface{}) []string
- func RowStringToInterface(r []string) []interface{}
- func TableInterfaceToString(t [][]interface{}) [][]string
- func TableStringToInterface(t [][]string) [][]interface{}
- func ValueInterfaceToString(val interface{}) (string, error)
- func ValueStringToInterface(s string) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RowInterfaceToString ¶
func RowInterfaceToString(r []interface{}) []string
RowInterfaceToString takes a 1D slice of interface{} and returns a 1D slice of string, of conversion then cell will be set to empty string.
func RowStringToInterface ¶
func RowStringToInterface(r []string) []interface{}
RowStringToInterface takes a 1D slice of string and returns a 1D slice of interface{}
func TableInterfaceToString ¶
func TableInterfaceToString(t [][]interface{}) [][]string
TableInterfaceToString takes a 2D slice of interface{} holding simple types (e.g. string, int, int64, float, float64, rune) and returns a 2D slice of string suitable for working with the csv encoder package. Uses ValueInterfaceToString() for conversion storing an empty string if they is an error.
func TableStringToInterface ¶
func TableStringToInterface(t [][]string) [][]interface{}
TableStringToInterface takes a 2D slice of string and returns an 2D slice of interface{}.
func ValueInterfaceToString ¶
ValueInterfaceToString - takes a interface{} and renders it as a string
func ValueStringToInterface ¶
ValueStringToInterface takes a string and returns an interface{}
Types ¶
This section is empty.