func (r *Rows) AddRow(values ...driver.Value) *Rows {
	if len(values) != len(r.cols) {
		panic("Expected number of values to match number of columns")
	}
	row := make([]driver.Value, len(r.cols))
	for i, v := range values {
		row[i] = v
	}
	r.rows = append(r.rows, row)
	return r
}
AddRow composed from database driver.Value slice
return the same instance to perform subsequent actions.
Note that the number of values must match the number
of columns
package sqlmock
import (
	"database/sql/driver"
	"encoding/csv"
	"fmt"
	"io"
	"strings"
)
var CSVColumnParser = func(s string) []byte {
	switch {
	case strings.ToLower(s) == "null":
		return nil
	}
	return []byte(s)
}
type rowSets struct {
	sets []*Rows
	pos  int
}
func (rs *rowSets) Columns() []string {
	return rs.sets[rs.pos].cols
}
func (rs *rowSets) Close() error {
	return rs.sets[rs.pos].closeErr
}
func (rs *rowSets) Next(dest []driver.Value) error {
	r := rs.sets[rs.pos]
	r.pos++
	if r.pos > len(r.rows) {
		return io.EOF  
	}
	for i, col := range r.rows[r.pos-1] {
		dest[i] = col
	}
	return r.nextErr[r.pos-1]
}
func (rs *rowSets) String() string {
	if rs.empty() {
		return "with empty rows"
	}
	msg := "should return rows:\n"
	if len(rs.sets) == 1 {
		for n, row := range rs.sets[0].rows {
			msg += fmt.Sprintf("    row %d - %+v\n", n, row)
		}
		return strings.TrimSpace(msg)
	}
	for i, set := range rs.sets {
		msg += fmt.Sprintf("    result set: %d\n", i)
		for n, row := range set.rows {
			msg += fmt.Sprintf("      row %d - %+v\n", n, row)
		}
	}
	return strings.TrimSpace(msg)
}
func (rs *rowSets) empty() bool {
	for _, set := range rs.sets {
		if len(set.rows) > 0 {
			return false
		}
	}
	return true
}
type Rows struct {
	cols     []string
	rows     [][]driver.Value
	pos      int
	nextErr  map[int]error
	closeErr error
}
func NewRows(columns []string) *Rows {
	return &Rows{cols: columns, nextErr: make(map[int]error)}
}
func (r *Rows) CloseError(err error) *Rows {
	r.closeErr = err
	return r
}
func (r *Rows) RowError(row int, err error) *Rows {
	r.nextErr[row] = err
	return r
}