(traceID []byte)
| 130 | } |
| 131 | |
| 132 | func PadTraceIDTo16Bytes(traceID []byte) []byte { |
| 133 | if len(traceID) > 16 { |
| 134 | return traceID[len(traceID)-16:] |
| 135 | } |
| 136 | |
| 137 | if len(traceID) == 16 { |
| 138 | return traceID |
| 139 | } |
| 140 | |
| 141 | padded := make([]byte, 16) |
| 142 | copy(padded[16-len(traceID):], traceID) |
| 143 | |
| 144 | return padded |
| 145 | } |
| 146 | |
| 147 | func hexStringToID(id string, isSpan bool) ([]byte, error) { |
| 148 | // The encoding/hex package does not handle non-hex characters. |
no outgoing calls