cli/pkg/prompt
Leo 70672aff18 feat(pkg/prompt/stubber): allow passing an error as Value
this allows testing error paths in code:

Pass an `error` type as the Value, it will be reflect-checked if it is
an error, and be returned

```golang
as, restoreAsk := prompt.InitAskStubber()
defer restoreAsk()

as.Stub([]*prompt.QuestionStub{
    {
        Name:  "assignee",
        Value: errors.New("meant to fail"),
    },
})
```

Example code that will benefit:

```golang
var confirmAnswers []string
err := prompt.MultiSelect(&confirmAnswers, "metadata", "Which metadata types to add?", options)
if err != nil {
    return nil, fmt.Errorf("could not prompt: %w", err)
}
```
2021-01-03 09:33:25 -03:00
..
prompt.go feat(pkg/prompt): add `Select()` to select a single option 2021-01-02 02:23:52 -03:00
stubber.go feat(pkg/prompt/stubber): allow passing an error as Value 2021-01-03 09:33:25 -03:00