ReadAll reads all the remaining records from r. Each record is a map of column name to field value.
()
| 45 | |
| 46 | // ReadAll reads all the remaining records from r. Each record is a map of column name to field value. |
| 47 | func (r *Reader) ReadAll() (records []map[string]string, err error) { |
| 48 | var record map[string]string |
| 49 | for record, err = r.Read(); err == nil; record, err = r.Read() { |
| 50 | records = append(records, record) |
| 51 | } |
| 52 | if err != nil && err != io.EOF { |
| 53 | return nil, err |
| 54 | } |
| 55 | return records, nil |
| 56 | } |
| 57 | |
| 58 | func min(x, y int) int { |
| 59 | if x <= y { |