1package squirrel 2 3// RowScanner is the interface that wraps the Scan method. 4// 5// Scan behaves like database/sql.Row.Scan. 6type RowScanner interface { 7 Scan(...interface{}) error 8} 9 10// Row wraps database/sql.Row to let squirrel return new errors on Scan. 11type Row struct { 12 RowScanner 13 err error 14} 15 16// Scan returns Row.err or calls RowScanner.Scan. 17func (r *Row) Scan(dest ...interface{}) error { 18 if r.err != nil { 19 return r.err 20 } 21 return r.RowScanner.Scan(dest...) 22} 23