The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language
The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language
The GoCSV package aims to provide easy serialization and deserialization functions to use CSV in Golang
go get -u github.com/gocarina/gocsv
Consider the following CSV file
client_id,client_name,client_age
1,Jose,42
2,Daniel,26
3,Vincent,32
……When decoding nested pointer structs, GoCSV allocates the pointers needed to
reach each field. An omitempty field still omits an empty leaf pointer value;
it does not prevent allocation of the enclosing structs.
By default, the fields of nested structs are prefixed with the parent field's name. For example:
type Foo struct {
B Bar
X int `csv:"x"`
}
type Bar struct {
A int `csv:"a"`
B int `csv:"b"`
}produces columns B.a, B.b, x.
Use the csv:"." tag to inline the nested struct's fields without that prefix; for example:
type Foo struct {
B Bar `csv:"."`
X int `csv:"x"`
}
type Bar struct {
A int `csv:"a"`
B int `csv:"b"`
}produces columns a, b, x.
…No open issues yet, or sync has not completed.