Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Unmarshal ¶
Unmarshal 根据列头信息反射到数组中 结构体映射分为三种情况: 一:第一行代表字段名,通过字段名映射 二:外部指定每列字段名 三:均没有指定的情况下,按照字段顺序映射 例如: client_id,client_name,client_age int,string,int id,name,age 1,Jose,42 2,Daniel,26 3,Vincent,32
type Client struct { // Our example struct, you can use "-" to ignore a field
Id string `csv:"client_id"` Name string `csv:"client_name"` Age string `csv:"client_age"` NotUsed string `csv:"-"` }
clients := []*Client{} Unmarshal(data, &clients)
Types ¶
type Options ¶
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.