ParseString
Overview
ParseString parses CSV text with a header row.
Part of the csv package — Node.js analog: papaparse.
Signature
go
func ParseString(s string) ([]map[string]string, error)Compare: Node.js · Standard Go · gox
js
// Typical papaparse pattern in Node.jsgo
r := csv.NewReader(f)
records, err := r.ReadAll()go
import "github.com/sahilkhaire/gox/csv"
rows, err := csv.ParseString(raw, csv.ReadOptions{Header: true})Example
go
import "github.com/sahilkhaire/gox/csv"
rows, err := csv.ParseString(raw, csv.ReadOptions{Header: true})Tips
Import github.com/sahilkhaire/gox/csv and call ParseString directly. See the comparison below for the standard library equivalent.
Standard library alternative
Use the standard library directly:
go
r := csv.NewReader(f)
records, err := r.ReadAll()