formatNumericKind formats numeric kinds without Interface() as a fallback.
(val reflect.Value)
| 536 | |
| 537 | // formatNumericKind formats numeric kinds without Interface() as a fallback. |
| 538 | func formatNumericKind(val reflect.Value) string { |
| 539 | switch val.Kind() { |
| 540 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
| 541 | return strconv.FormatInt(val.Int(), 10) |
| 542 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: |
| 543 | return strconv.FormatUint(val.Uint(), 10) |
| 544 | case reflect.Float32, reflect.Float64: |
| 545 | return fmt.Sprintf("%f", val.Float()) |
| 546 | default: |
| 547 | return val.Type().String() |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | // formatFieldValueWithTag formats a reflect.Value as a string for display with format tag support |
| 552 | func formatFieldValueWithTag(val reflect.Value, tag consoleTag) string { |
no test coverage detected