(fields []string)
| 280 | } |
| 281 | |
| 282 | func (code Code) ExportData(fields []string) map[string]interface{} { |
| 283 | v := reflect.ValueOf(code) |
| 284 | data := map[string]interface{}{} |
| 285 | for _, f := range fields { |
| 286 | switch f { |
| 287 | case "textMatches": |
| 288 | matches := make([]interface{}, 0, len(code.TextMatches)) |
| 289 | for _, match := range code.TextMatches { |
| 290 | matches = append(matches, match.ExportData(textMatchFields)) |
| 291 | } |
| 292 | data[f] = matches |
| 293 | default: |
| 294 | sf := fieldByName(v, f) |
| 295 | data[f] = sf.Interface() |
| 296 | } |
| 297 | } |
| 298 | return data |
| 299 | } |
| 300 | |
| 301 | func (textMatch TextMatch) ExportData(fields []string) map[string]interface{} { |
| 302 | return cmdutil.StructExportData(textMatch, fields) |
nothing calls this directly
no test coverage detected