WithPromptFunc sets the prompt function to be used by the [Reader]. If set, this function will be called with prompt messages. The function should optionally log the message to the user and return nil if the prompt is accepted and the execution should continue. Otherwise, it should return an error w
(promptFunc PromptFunc)
| 192 | // and used later when calling the [Reader.Read] method. By default, no prompt |
| 193 | // function is set and all prompts are automatically accepted. |
| 194 | func WithPromptFunc(promptFunc PromptFunc) ReaderOption { |
| 195 | return &promptFuncOption{promptFunc: promptFunc} |
| 196 | } |
| 197 | |
| 198 | type promptFuncOption struct { |
| 199 | promptFunc PromptFunc |
no outgoing calls
no test coverage detected
searching dependent graphs…