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

Method WriteAnswer

pkg/cmd/workflow/run/run.go:198–211  ·  view source on GitHub ↗
(name string, value any)

Source from the content-addressed store, hash-verified

196}
197
198func (ia *InputAnswer) WriteAnswer(name string, value any) error {
199 if s, ok := value.(string); ok {
200 ia.providedInputs[name] = s
201 return nil
202 }
203
204 // TODO i hate this; this is to make tests work:
205 if rv, ok := value.(reflect.Value); ok {
206 ia.providedInputs[name] = rv.String()
207 return nil
208 }
209
210 return fmt.Errorf("unexpected value type: %v", value)
211}
212
213func collectInputs(p iprompter, yamlContent []byte) (map[string]string, error) {
214 inputs, err := findInputs(yamlContent)

Callers

nothing calls this directly

Calls 2

StringMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected