Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gocsv

> 编程语言
Open source

The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language

2.2K stars0 likes1 views
WebsiteGitHub

About

The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language

Go CSV

The GoCSV package aims to provide easy serialization and deserialization functions to use CSV in Golang

API and techniques inspired from https://godoc.org/gopkg.in/mgo.v2 Installation

go get -u github.com/gocarina/gocsv

Full example

Consider the following CSV file

csv

client_id,client_name,client_age
1,Jose,42
2,Daniel,26
3,Vincent,32

Easy binding in Go!

…

Customizable Converters

…

Nested structs

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:

go
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:

go
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.

Customizable CSV Reader / Writer

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言