check if fieldname is "in" one of the fields in fis, or if one of fis is "in" fieldname, where "in" means "equal or is a suffix of".
(fieldname field.Path, fis []fieldInfo)
| 126 | // check if fieldname is "in" one of the fields in fis, or if |
| 127 | // one of fis is "in" fieldname, where "in" means "equal or is a suffix of". |
| 128 | func isIn(fieldname field.Path, fis []fieldInfo) bool { |
| 129 | // check if fieldname of splits is "in" one of fis |
| 130 | for i := range fieldname { |
| 131 | sub := fieldname[:i+1] |
| 132 | for _, fi := range fis { |
| 133 | if sub.Equal(fi.field) { |
| 134 | return true |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | // check if one of fis is "in" fieldname |
| 139 | for _, fi := range fis { |
| 140 | for i := range fi.field { |
| 141 | prefix := fi.field[:i+1] |
| 142 | if prefix.Equal(fieldname) { |
| 143 | return true |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | return false |
| 148 | } |
| 149 | |
| 150 | func (r *RecordBuilder) Reset() { |
| 151 | r.builder.Reset() |
no test coverage detected