TableHeaderChar returns the special header character based on given data type
(typ reflect.Kind)
| 279 | |
| 280 | // TableHeaderChar returns the special header character based on given data type |
| 281 | func TableHeaderChar(typ reflect.Kind) byte { |
| 282 | switch { |
| 283 | case typ == reflect.Bool: |
| 284 | return '^' |
| 285 | case typ == reflect.Float32: |
| 286 | return '%' |
| 287 | case typ == reflect.Float64: |
| 288 | return '#' |
| 289 | case typ >= reflect.Int && typ <= reflect.Uintptr: |
| 290 | return '|' |
| 291 | default: |
| 292 | return '$' |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | // TableColumnType parses the column header for special table type information |
| 297 | func TableColumnType(nm string) (reflect.Kind, string) { |