add NewRow from rows

This commit is contained in:
Lunny Xiao 2017-08-22 13:50:40 +08:00
parent 6902127083
commit 71c1070a86
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 5 additions and 0 deletions

View File

@ -254,6 +254,11 @@ func ErrorRow(err error) *Row {
}
}
// NewRow from rows
func NewRow(rows *Rows, err error) *Row {
return &Row{rows, err}
}
func (row *Row) Columns() ([]string, error) {
if row.err != nil {
return nil, row.err