MCPcopy
hub / github.com/danielgtaylor/huma / PushIndex

Method PushIndex

validate.go:95–100  ·  view source on GitHub ↗

PushIndex pushes an entry onto the path surrounded by `[` and `]`. pb.Push("foo") // foo pb.PushIndex(1) // foo[1]

(i int)

Source from the content-addressed store, hash-verified

93// pb.Push("foo") // foo
94// pb.PushIndex(1) // foo[1]
95func (b *PathBuffer) PushIndex(i int) {
96 b.buf = append(b.buf, '[')
97 b.buf = strconv.AppendInt(b.buf, int64(i), 10)
98 b.buf = append(b.buf, ']')
99 b.off = len(b.buf)
100}
101
102// Pop the latest entry off the path.
103//

Callers 4

WithIndexMethod · 0.95
BenchmarkPathBufferFunction · 0.95
handleArrayFunction · 0.80
everyPBMethod · 0.80

Calls

no outgoing calls

Tested by 1

BenchmarkPathBufferFunction · 0.76