MCPcopy
hub / github.com/h2oai/wave / get

Function get

card.go:166–186  ·  view source on GitHub ↗
(ix any, k string)

Source from the content-addressed store, hash-verified

164}
165
166func get(ix any, k string) any {
167 switch x := ix.(type) {
168 case Buf:
169 if r, ok := x.get(k); ok {
170 return r
171 }
172 case Cur:
173 return x.get(k)
174 case map[string]any:
175 if v, ok := x[k]; ok {
176 return v
177 }
178 case []any:
179 if i, err := strconv.Atoi(k); err == nil {
180 if i >= 0 && i < len(x) {
181 return x[i]
182 }
183 }
184 }
185 return nil
186}
187
188func (c *Card) dump() CardD {
189 data := make(map[string]any)

Callers 1

setMethod · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected