(f reflect.StructField, tag string, def bool)
| 348 | } |
| 349 | |
| 350 | func boolTag(f reflect.StructField, tag string, def bool) bool { |
| 351 | if v := f.Tag.Get(tag); v != "" { |
| 352 | switch v { |
| 353 | case "true": |
| 354 | return true |
| 355 | case "false": |
| 356 | return false |
| 357 | default: |
| 358 | panic(fmt.Errorf("invalid bool tag '%s' for field '%s': %v", tag, f.Name, v)) |
| 359 | } |
| 360 | } |
| 361 | return def |
| 362 | } |
| 363 | |
| 364 | func intTag(f reflect.StructField, tag string) *int { |
| 365 | if v := f.Tag.Get(tag); v != "" { |
no test coverage detected
searching dependent graphs…