()
| 270 | } |
| 271 | |
| 272 | func (m *AskMocker) receiveQuestion() (survey.Prompt, *survey.AskOptions, bool) { |
| 273 | if m.Closed { |
| 274 | return nil, nil, false |
| 275 | } |
| 276 | request := <-m.Question |
| 277 | return request.question, request.options, !m.Closed // reading from closed channels works fine and just returns the default |
| 278 | } |
| 279 | |
| 280 | // sendAnswer blindly sends an answer down the answer channel, regardless of whether |
| 281 | // a question has been asked or not. You should use ExpectQuestion.AnswerWith instead of this |