formatHex prints u as a hexadecimal integer in Go notation.
(u uint64)
| 391 | |
| 392 | // formatHex prints u as a hexadecimal integer in Go notation. |
| 393 | func formatHex(u uint64) string { |
| 394 | var f string |
| 395 | switch { |
| 396 | case u <= 0xff: |
| 397 | f = "0x%02x" |
| 398 | case u <= 0xffff: |
| 399 | f = "0x%04x" |
| 400 | case u <= 0xffffff: |
| 401 | f = "0x%06x" |
| 402 | case u <= 0xffffffff: |
| 403 | f = "0x%08x" |
| 404 | case u <= 0xffffffffff: |
| 405 | f = "0x%010x" |
| 406 | case u <= 0xffffffffffff: |
| 407 | f = "0x%012x" |
| 408 | case u <= 0xffffffffffffff: |
| 409 | f = "0x%014x" |
| 410 | case u <= 0xffffffffffffffff: |
| 411 | f = "0x%016x" |
| 412 | } |
| 413 | return fmt.Sprintf(f, u) |
| 414 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…