(timeFactor int32)
| 60 | } |
| 61 | |
| 62 | func getTimePrecision(timeFactor int32) (string, error) { |
| 63 | switch timeFactor { |
| 64 | case 1_000: |
| 65 | return MILLISECOND, nil |
| 66 | case 1_000_000: |
| 67 | return MICROSECOND, nil |
| 68 | case 1_000_000_000: |
| 69 | return NANOSECOND, nil |
| 70 | default: |
| 71 | return "", fmt.Errorf("unknown time factor: %v", timeFactor) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func formatDatetime(timeFormat, timePrecision string, timestamp int64, zone *time.Location) string { |
| 76 | switch timeFormat { |
no outgoing calls
no test coverage detected
searching dependent graphs…