MCPcopy Create free account
hub / github.com/cli/cli / condition

Function condition

script/ghmock/gqlscaffold.go:358–366  ·  view source on GitHub ↗
(d *ast.Directive, vars map[string]any)

Source from the content-addressed store, hash-verified

356}
357
358func condition(d *ast.Directive, vars map[string]any) bool {
359 arg := d.Arguments.ForName("if")
360 if arg == nil {
361 return false
362 }
363 v, err := arg.Value.Value(vars)
364 b, ok := v.(bool)
365 return err == nil && ok && b
366}
367
368// arguments evaluates a field's arguments, filling in defaults.
369func (s *gqlScaffolder) arguments(f *ast.Field) map[string]any {

Callers 1

skippedByFunction · 0.85

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected