add ErrorRow function

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

View File

@ -247,6 +247,13 @@ type Row struct {
err error // deferred error for easy chaining
}
// ErrorRow return an error row
func ErrorRow(err error) *Row {
return &Row{
err: err,
}
}
func (row *Row) Columns() ([]string, error) {
if row.err != nil {
return nil, row.err