(fieldsCount int)
| 36 | } |
| 37 | |
| 38 | func (r *Resultset) Reset(fieldsCount int) { |
| 39 | r.RawPkg = r.RawPkg[:0] |
| 40 | |
| 41 | r.Fields = r.Fields[:0] |
| 42 | r.Values = r.Values[:0] |
| 43 | r.RowDatas = r.RowDatas[:0] |
| 44 | |
| 45 | if r.FieldNames != nil { |
| 46 | for k := range r.FieldNames { |
| 47 | delete(r.FieldNames, k) |
| 48 | } |
| 49 | } else { |
| 50 | r.FieldNames = make(map[string]int) |
| 51 | } |
| 52 | |
| 53 | if fieldsCount == 0 { |
| 54 | return |
| 55 | } |
| 56 | |
| 57 | if cap(r.Fields) < fieldsCount { |
| 58 | r.Fields = make([]*Field, fieldsCount) |
| 59 | } else { |
| 60 | r.Fields = r.Fields[:fieldsCount] |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func (r *Resultset) RowNumber() int { |
| 65 | return len(r.Values) |
no outgoing calls
no test coverage detected