(dst []byte, major byte, number uint64)
| 72 | var NanoTimeFieldFormat = time.RFC3339Nano |
| 73 | |
| 74 | func appendCborTypePrefix(dst []byte, major byte, number uint64) []byte { |
| 75 | var byteCount int |
| 76 | var minor byte |
| 77 | switch { |
| 78 | case number < 256: |
| 79 | byteCount = 1 |
| 80 | minor = additionalTypeIntUint8 |
| 81 | |
| 82 | case number < 65536: |
| 83 | byteCount = 2 |
| 84 | minor = additionalTypeIntUint16 |
| 85 | |
| 86 | case number < 4294967296: |
| 87 | byteCount = 4 |
| 88 | minor = additionalTypeIntUint32 |
| 89 | |
| 90 | default: |
| 91 | byteCount = 8 |
| 92 | minor = additionalTypeIntUint64 |
| 93 | |
| 94 | } |
| 95 | |
| 96 | dst = append(dst, major|minor) |
| 97 | byteCount-- |
| 98 | for ; byteCount >= 0; byteCount-- { |
| 99 | dst = append(dst, byte(number>>(uint(byteCount)*8))) |
| 100 | } |
| 101 | return dst |
| 102 | } |
no outgoing calls
no test coverage detected