(value interface{})
| 30 | } |
| 31 | |
| 32 | func getFormatModifier(value interface{}) string { |
| 33 | switch value.(type) { |
| 34 | case string: |
| 35 | return "s" |
| 36 | case float32, float64: |
| 37 | return ".2f" |
| 38 | case int8, int16, int32, int64, int, uint8, uint16, uint32, uint64, uint: |
| 39 | return "d" |
| 40 | default: |
| 41 | return "v" |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func expandColumnWidth(columnWidths []int, value interface{}, idx int) { |
| 46 | valueWidth := len(fmt.Sprintf("%"+getFormatModifier(value), value)) |
no outgoing calls
no test coverage detected