MCPcopy Create free account
hub / github.com/blues/note / processArrayValue

Function processArrayValue

lib/bulk.go:2244–2252  ·  view source on GitHub ↗
(ctx context.Context, tmplContext *BulkTemplateContext, level int, index int, a *fastjson.Value, da []T)

Source from the content-addressed store, hash-verified

2242}
2243
2244func processArrayValue[T any](ctx context.Context, tmplContext *BulkTemplateContext, level int, index int, a *fastjson.Value, da []T) (err error) {
2245 arrayKey := fmt.Sprintf("[%d]", index)
2246
2247 if index < len(da) {
2248 return tmplContext.processTemplateValue(ctx, level, a, arrayKey, da[index])
2249 } else {
2250 return tmplContext.processTemplateValue(ctx, level, a, arrayKey, nil)
2251 }
2252}
2253
2254// Decode an object
2255func (tmplContext *BulkTemplateContext) walkObjectInto(ctx context.Context, level int, o *fastjson.Object, do map[string]interface{}) (err error) {

Callers 1

walkArrayMethod · 0.85

Calls 1

processTemplateValueMethod · 0.80

Tested by

no test coverage detected