Skip to content
Node: papaparsegithub.com/sahilkhaire/gox/csv

ReadAll

Overview

ReadAll reads a CSV file at path.

Part of the csv package — Node.js analog: papaparse.

Signature

go
func ReadAll(ctx context.Context, path string) ([]map[string]string, error)

Compare: Node.js · Standard Go · gox

js
// Typical papaparse pattern in Node.js
go
r := csv.NewReader(f)
records, err := r.ReadAll()
go
import "github.com/sahilkhaire/gox/csv"

rows, err := csv.ReadAll(ctx, "data.csv")

Example

go
import "github.com/sahilkhaire/gox/csv"

rows, err := csv.ReadAll(ctx, "data.csv")

Tips

Import github.com/sahilkhaire/gox/csv and call ReadAll 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()

Back to csv package overview

MIT Licensed · Built for Node.js developers moving to Go