MCPcopy Create free account
hub / github.com/chain/txvm / appendPrefix

Function appendPrefix

log/log.go:61–75  ·  view source on GitHub ↗
(b []byte, keyval ...interface{})

Source from the content-addressed store, hash-verified

59}
60
61func appendPrefix(b []byte, keyval ...interface{}) []byte {
62 // Invariant: len(keyval) is always even.
63 if len(keyval)%2 != 0 {
64 panic(fmt.Sprintf("odd-length prefix args: %v", keyval))
65 }
66 for i := 0; i < len(keyval); i += 2 {
67 k := formatKey(keyval[i])
68 v := formatValue(keyval[i+1])
69 b = append(b, k...)
70 b = append(b, '=')
71 b = append(b, v...)
72 b = append(b, ' ')
73 }
74 return b
75}
76
77// SetPrefix sets the global output prefix.
78func SetPrefix(keyval ...interface{}) {

Callers 2

SetPrefixFunction · 0.85
AddPrefixkvFunction · 0.85

Calls 2

formatKeyFunction · 0.85
formatValueFunction · 0.85

Tested by

no test coverage detected