From 48f19f60aa3e162146a9dc4edf7b4c8cf687ec26 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 27 Jun 2020 00:02:47 +0800 Subject: support the row element without r attribute in the worksheet --- col.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'col.go') diff --git a/col.go b/col.go index d6f0690..0baa2e4 100644 --- a/col.go +++ b/col.go @@ -42,18 +42,14 @@ type Cols struct { // GetCols return all the columns in a sheet by given worksheet name (case // sensitive). For example: // -// cols, err := f.Cols("Sheet1") +// cols, err := f.GetCols("Sheet1") // if err != nil { // fmt.Println(err) // return // } -// for cols.Next() { -// col, err := cols.Rows() -// if err != nil { -// fmt.Println(err) -// } -// for _, rowCell := range col { -// fmt.Print(rowCell, "\t") +// for _, col := range cols { +// for _, colCell := range col { +// fmt.Println(colCell, "\t") // } // fmt.Println() // } @@ -71,13 +67,13 @@ func (f *File) GetCols(sheet string) ([][]string, error) { return results, nil } -// Next will return true if the next col element is found. +// Next will return true if the next column is found. func (cols *Cols) Next() bool { cols.curCol++ return cols.curCol <= cols.totalCol } -// Error will return an error when the next col element is found. +// Error will return an error when the error occurs. func (cols *Cols) Error() error { return cols.err } @@ -127,7 +123,7 @@ func (cols *Cols) Rows() ([]string, error) { return rows, nil } -// Cols returns a columns iterator, used for streaming/reading data for a +// Cols returns a columns iterator, used for streaming reading data for a // worksheet with a large data. For example: // // cols, err := f.Cols("Sheet1") -- cgit v1.2.1