tbl

package
v2.0.0-a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

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

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

func ValueInterfaceToString(val interface{}) (string, error)

ValueInterfaceToString - takes a interface{} and renders it as a string

func ValueStringToInterface

func ValueStringToInterface(s string) (interface{}, error)

ValueStringToInterface takes a string and returns an interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL