Documentation
¶
Overview ¶
Package csv wraps encoding/csv as a codec.Codec implementation. The CSV format serialises a matrix of strings; the codec accepts [][]string for Marshal and writes into *[][]string on Unmarshal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //: Codec is the CSV singleton, registered with core/data/codec at package //: load. Binding the registration result to a named var is more //: idiomatic than `var _ = codec.Register(...)` and keeps us clear of //: init(). The singleton has escapeFormulas=false for wire-format //: fidelity — consumers whose output is read by a spreadsheet //: application should use NewWithEscape(true) instead. Codec codec.Codec = codec.Register(&csvCodec{}) )
Package-level vars: the Marshal-buffer pool plus the singleton registered with core/data/codec at package load.
Functions ¶
func New ¶
New returns the CSV singleton with escapeFormulas disabled. This preserves the v1 API and keeps the wire-format lossless for pipe-to-pipe use.
func NewWithEscape ¶
NewWithEscape returns a fresh CSV codec with the formula-injection mitigation toggled on or off. Use this constructor when the encoded output will be opened in a spreadsheet app (Excel, LibreOffice, Google Sheets): without the mitigation an attacker-influenced cell starting with "=" evaluates as a formula at open time, which is OWASP CSV Injection (CWE-1236). The returned codec is not registered with the core/data/codec singleton registry.
Types ¶
This section is empty.