summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-01-03 23:57:25 +0800
committerxuri <xuri.me@gmail.com>2020-01-03 23:57:25 +0800
commit5ca7231ed408ac264f509ff52b5d28ff4fbda757 (patch)
treeaf91efcb8b83c75c97cb43c9fac442adccfdcd26 /rows.go
parent5f5ec76740704a8362e5a120b4a3582b409a5fdd (diff)
optimize code and comments: use println errors instead of panic
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/rows.go b/rows.go
index d24b1a6..40972ae 100644
--- a/rows.go
+++ b/rows.go
@@ -63,7 +63,6 @@ type Rows struct {
err error
curRow, totalRow, stashRow int
sheet string
- stashColumn []string
rows []xlsxRow
f *File
decoder *xml.Decoder
@@ -111,7 +110,6 @@ func (rows *Rows) Columns() ([]string, error) {
}
if row > rows.curRow {
rows.stashRow = row - 1
- rows.stashColumn = columns
return columns, err
}
}
@@ -153,12 +151,19 @@ func (err ErrSheetNotExist) Error() string {
// Rows return a rows iterator. For example:
//
// rows, err := f.Rows("Sheet1")
+// if err != nil {
+// println(err.Error())
+// return
+// }
// for rows.Next() {
// row, err := rows.Columns()
+// if err != nil {
+// println(err.Error())
+// }
// for _, colCell := range row {
-// fmt.Print(colCell, "\t")
+// print(colCell, "\t")
// }
-// fmt.Println()
+// println()
// }
//
func (f *File) Rows(sheet string) (*Rows, error) {