diff options
author | ducquangkstn <ducquang.kstn@gmail.com> | 2019-10-18 13:57:35 +0700 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-10-18 14:57:35 +0800 |
commit | 866fda230028a3a9e6ff1c5234e432ad850d3c6b (patch) | |
tree | c106df97c87b9230e2f5010f3e232978f974b6c5 /rows.go | |
parent | 2e791fa433def282ee2e7a5049a46fc4a76796cf (diff) |
fix #503 rows next issue
Diffstat (limited to 'rows.go')
-rw-r--r-- | rows.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -57,7 +57,8 @@ type Rows struct { // Next will return true if find the next row element. func (rows *Rows) Next() bool { - return rows.curRow < len(rows.rows) + rows.curRow++ + return rows.curRow <= len(rows.rows) } // Error will return the error when the find next row element @@ -67,8 +68,7 @@ func (rows *Rows) Error() error { // Columns return the current row's column values func (rows *Rows) Columns() ([]string, error) { - curRow := rows.rows[rows.curRow] - rows.curRow++ + curRow := rows.rows[rows.curRow-1] columns := make([]string, len(curRow.C)) d := rows.f.sharedStringsReader() |