code: func (d *Database) ScanAll(rows *sql.Rows, dst interface{}) error {
  	// make sure we always close rows
  	defer rows.Close()
  
  	// make sure dst is an appropriate type
  	dstVal := reflect.ValueOf(dst)
  	if dstVal.Kind() != reflect.Ptr || dstVal.IsNil() {
  		return fmt.Errorf("ScanAll called with non-pointer destination: %T", dst)
  	}
  	sliceVal := dstVal.Elem()
  	if sliceVal.Kind() != reflect.Slice {
  		return fmt.Errorf("ScanAll called with pointer to non-slice: %T", dst)
  	}
  	ptrType := sliceVal.Type().Elem()
  	if ptrType.Kind() != reflect.Ptr {
  		return fmt.Errorf("ScanAll expects element to be pointers, found %T", dst)
  	}
  	eltType := ptrType.Elem()
  	if eltType.Kind() != reflect.Struct {
  		return fmt.Errorf("ScanAll expects element to be pointers to structs, found %T", dst)
  	}
  
  	// get the list of struct fields
  	data, err := getFields(ptrType)
  	if err != nil {
  		return err
  	}
  
  	// get the sql columns
  	columns, err := rows.Columns()
  	if err != nil {
  		return err
  	}
  
  	// gather the results
  	for {
  		// create a new element
  		eltVal := reflect.New(eltType)
  		elt := eltVal.Interface()
  
  		// scan it
  		if err := d.scanRow(data, rows, elt, columns); err != nil {
  			if err == sql.ErrNoRows {
  				return nil
  			}
  			return err
  		}
  
  		// add to the result slice
  		sliceVal.Set(reflect.Append(sliceVal, eltVal))
  	}
  }
docs: // ScanAll scans all sql result rows into a slice of structs.
  // It reads all rows and closes rows when finished.
  // dst should be a pointer to a slice of the appropriate type.
  // The new results will be appended to any existing data in dst.