csv2

package
v0.0.0-...-5bf8bb3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	TagName               string
	ColumnNamesInFirstRow bool
	Reader                *csv.Reader
	// contains filtered or unexported fields
}

Reader is a wrapper for standard library CSV Reader that allows unmarshalling into a slice of structs.

func NewReader

func NewReader(r *csv.Reader) *Reader

NewReader creates a new reader from a standard CSV Reader.

func (*Reader) Load

func (r *Reader) Load(dest interface{}) error

Load reads CSV contents and unmarshals them into given destination. Destination value must be a pointer to a slice of structs.

func (*Reader) SetColumnNames

func (r *Reader) SetColumnNames(cols []string)

SetColumnNames assigns column names. Use this function if column names are not provided in the first row.

Jump to

Keyboard shortcuts

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