csv

package
v0.26.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

README

CSV

A writer for CSV format.

As opposed to the poor CSV writer of the standard library, this writer is using double quotes for strings and is able to distinguish different types of input variables. To do so, it uses the interface (any) type variables to emulate dynamic types.

Documentation

Index

Constants

View Source
const (
	ErrFDataTypeIsUnsupported = "data type is unsupported: %s"
	ErrNoDataInRow            = "no data in row"
	ErrFRowSizeMismatch       = "row size mismatch: %v vs %v"
)

Errors.

View Source
const (
	CommaStr   = `,`
	NewLineStr = "\r\n" // RFC 4180.
)

Settings.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer is a simple CSV writer.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter is a constructor of a CSV writer.

func (*Writer) WriteRow

func (w *Writer) WriteRow(row []any) (err error)

WriteRow writes a row of cells.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL