csv

package
v0.0.0-...-9006291 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInputStruct  = errors.New("invalid data input struct, make sure interface{} is *struct")
	ErrInvalidDataSource   = errors.New("invalid data source, please check csv data")
	ErrUnsupportedDataType = errors.New("unsupported data type")
)

Functions

func LoadData

func LoadData(file string, v interface{}) (map[string]interface{}, error)

LoadData 加载数据,失败返回 error

func MustLoad

func MustLoad(file string, v interface{}) map[string]interface{}

MustLoad 必须加载成功数据才能启动

Types

type FieldKind

type FieldKind uint8

FieldKind 数据类型。 注:为什么不直接用 reflect.Kind, 因为不是所有类型都支持转化,不支持的自动转变为 Invalid

const (
	Invalid FieldKind = iota
	Bool
	Int
	Int8
	Int16
	Int32
	Int64
	Uint
	Uint8
	Uint16
	Uint32
	Uint64
	Float32
	Float64
	Map
	Slice
	String
)

Jump to

Keyboard shortcuts

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