data

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Example
file, err := os.Open("example.csv")

if err != nil {
	log.Fatal(err)
}

iterator := NewIterator(csv.NewReader(file), factory)

for iterator.Next() {
	s := iterator.Sample().(sample)

	fmt.Printf("%s %s\n", s.a, s.b)
}
Output:

foo bar
bar baz

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

func NewIterator

func NewIterator(reader *csv.Reader, factory func([]string) (interface{}, error)) *Iterator

func (*Iterator) Error

func (i *Iterator) Error() error

func (*Iterator) Next

func (i *Iterator) Next() bool

func (*Iterator) Sample

func (i *Iterator) Sample() interface{}

func (*Iterator) Skip

func (i *Iterator) Skip() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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