utils

package
v0.0.0-...-157372e Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(path string)

func CountLinesInCSV

func CountLinesInCSV(path string) (int64, error)

func GetIndexOfColumn

func GetIndexOfColumn(header []string, column string) (int, error)

func SliceToString

func SliceToString(imploded []string) string

SliceToString returns a comma separate list as a string when given a slice of strings

func StringMap

func StringMap(ss []string, f func(string) string) []string

StringMap takes a slice of strings and a function and returns a new slice with the function aplied to each member of the slice

func StringMapToSlice

func StringMapToSlice(in map[string]string) []string

StringMapToSlice returns a sorted slice of strings from given map

Types

type CSVReader

type CSVReader struct {
	File *os.File
	Gr   *gzip.Reader
	Cr   *csv.Reader
}

func NewReader

func NewReader(filePath string) (CSVReader, error)

func (CSVReader) Close

func (r CSVReader) Close() error

func (CSVReader) Line

func (r CSVReader) Line() ([]string, error)

func (CSVReader) Read

func (r CSVReader) Read() ([]string, error)

Jump to

Keyboard shortcuts

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