Error sends an error message to the user
(msg ...any)
| 80 | |
| 81 | // Error sends an error message to the user |
| 82 | func (i *InfoBuf) Error(msg ...any) { |
| 83 | // only display a new message if there isn't an active prompt |
| 84 | // this is to prevent overwriting an existing prompt to the user |
| 85 | if !i.HasPrompt { |
| 86 | // if there is no active prompt then style and display the message as normal |
| 87 | i.Msg = fmt.Sprint(msg...) |
| 88 | i.HasMessage, i.HasError = false, true |
| 89 | } |
| 90 | // TODO: add to log? |
| 91 | } |
| 92 | |
| 93 | // Prompt starts a prompt for the user, it takes a prompt, a possibly partially filled in msg |
| 94 | // and callbacks executed when the user executes an event and when the user finishes the prompt |
no outgoing calls