MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / subs

Method subs

dql/math.go:347–366  ·  view source on GitHub ↗
(vmap varMap)

Source from the content-addressed store, hash-verified

345}
346
347func (t *MathTree) subs(vmap varMap) error {
348 if strings.HasPrefix(t.Var, "$") {
349 va, ok := vmap[t.Var]
350 if !ok {
351 return errors.Errorf("Variable not found in math")
352 }
353 var err error
354 t.Const, err = parseValue(va)
355 if err != nil {
356 return err
357 }
358 t.Var = ""
359 }
360 for _, i := range t.Child {
361 if err := i.subs(vmap); err != nil {
362 return err
363 }
364 }
365 return nil
366}
367
368// debugString converts mathTree to a string. Good for testing, debugging.
369// nolint: unused

Callers 1

substituteVarInMathFunction · 0.80

Calls 2

parseValueFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected