techcentaur / csvbytes

CSV Parser which returns [][]byte

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

csvbytes

Low allocation CSV Parser which returns [][]byte

This is a modified version of the Golang standard library csv parser.

Golang standard csv parser

The difference is that this implementation returns a slice of bytes to reduce allocations

func (r *Reader) Read() (record [][]byte, err error) 

Please handle the byte slice with care as its contents will be destroyed by the next read.

installation

$ go get github.com/telecoda/csvbytes

running tests

$ go test ./... -bench=. -v

results

=== RUN   TestParser
--- PASS: TestParser (0.00s)

BenchmarkParser-8   	  500000	      2869 ns/op    4640 B/op	      12 allocs/op
PASS
ok  	github.com/telecoda/csvbytes	1.474s

About

CSV Parser which returns [][]byte

License:MIT License


Languages

Language:Go 100.0%