MCPcopy Create free account
hub / github.com/Cyinx/einx / itoa

Function itoa

slog/slog_utils.go:7–23  ·  view source on GitHub ↗
(buf *[]byte, i int, wid int)

Source from the content-addressed store, hash-verified

5)
6
7func itoa(buf *[]byte, i int, wid int) {
8 var u uint = uint(i)
9 if u == 0 && wid <= 1 {
10 *buf = append(*buf, '0')
11 return
12 }
13
14 // Assemble decimal in reverse order.
15 var b [32]byte
16 bp := len(b)
17 for ; u > 0 || wid > 0; u /= 10 {
18 bp--
19 wid--
20 b[bp] = byte(u%10) + '0'
21 }
22 *buf = append(*buf, b[bp:]...)
23}
24
25func formatHeader(buf *[]byte, lv Level, t time.Time) {
26 debug_string := lv.String()

Callers 1

formatHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…