MCPcopy
hub / github.com/uber/aresdb / getFormatModifier

Function getFormatModifier

utils/table_writer.go:32–43  ·  view source on GitHub ↗
(value interface{})

Source from the content-addressed store, hash-verified

30}
31
32func 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
45func expandColumnWidth(columnWidths []int, value interface{}, idx int) {
46 valueWidth := len(fmt.Sprintf("%"+getFormatModifier(value), value))

Callers 3

expandColumnWidthFunction · 0.85
WriteTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected