type Record struct {
Name string csv:"name"
Age int csv:"age"
}
func main() {
records := []*Record{}
err := gocsv.UnmarshalFile(“data.csv”, &records)
if err != nil {
panic(err)
}
fmt.Println(records)
}
原创文章,作者:IT_editor,如若转载,请注明出处:https://docs.ihr360.com/tech_arch/new_tect/27852