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

Method WithIndex

validate.go:136–141  ·  view source on GitHub ↗

WithIndex is short for push index, convert to string, and pop. This is useful when you want the location of the index given a path buffer as a prefix. pb.Push("foo") pb.WithIndex(1) // return foo[1]

(i int)

Source from the content-addressed store, hash-verified

134// pb.Push("foo")
135// pb.WithIndex(1) // return foo[1]
136func (b *PathBuffer) WithIndex(i int) string {
137 b.PushIndex(i)
138 tmp := b.String()
139 b.Pop()
140 return tmp
141}
142
143// Len returns the length of the current path.
144func (b *PathBuffer) Len() int {

Calls 3

PushIndexMethod · 0.95
StringMethod · 0.95
PopMethod · 0.95