(ask question.Asker, questionText string, itemsCallback func() []*SelectOption[T])
| 32 | } |
| 33 | |
| 34 | func SelectOptions[T any](ask question.Asker, questionText string, itemsCallback func() []*SelectOption[T]) (*SelectOption[T], error) { |
| 35 | items := itemsCallback() |
| 36 | callback := func() ([]*SelectOption[T], error) { |
| 37 | return items, nil |
| 38 | } |
| 39 | return Select(ask, questionText, callback, func(option *SelectOption[T]) string { return option.Display }) |
| 40 | } |
| 41 | |
| 42 | func Select[T any](ask question.Asker, questionText string, itemsCallback func() ([]T, error), getKey func(item T) string) (T, error) { |
| 43 | items, err := itemsCallback() |
no test coverage detected