A UI manages user interactions.
| 204 | |
| 205 | // A UI manages user interactions. |
| 206 | type UI interface { |
| 207 | // ReadLine returns a line of text (a command) read from the user. |
| 208 | // prompt is printed before reading the command. |
| 209 | ReadLine(prompt string) (string, error) |
| 210 | |
| 211 | // Print shows a message to the user. |
| 212 | // It formats the text as fmt.Print would and adds a final \n if not already present. |
| 213 | // For line-based UI, Print writes to standard error. |
| 214 | // (Standard output is reserved for report data.) |
| 215 | Print(...interface{}) |
| 216 | |
| 217 | // PrintErr shows an error message to the user. |
| 218 | // It formats the text as fmt.Print would and adds a final \n if not already present. |
| 219 | // For line-based UI, PrintErr writes to standard error. |
| 220 | PrintErr(...interface{}) |
| 221 | |
| 222 | // IsTerminal returns whether the UI is known to be tied to an |
| 223 | // interactive terminal (as opposed to being redirected to a file). |
| 224 | IsTerminal() bool |
| 225 | |
| 226 | // WantBrowser indicates whether browser should be opened with the -http option. |
| 227 | WantBrowser() bool |
| 228 | |
| 229 | // SetAutoComplete instructs the UI to call complete(cmd) to obtain |
| 230 | // the auto-completion of cmd, if the UI supports auto-completion at all. |
| 231 | SetAutoComplete(complete func(string) string) |
| 232 | } |
| 233 | |
| 234 | // internalObjTool is a wrapper to map from the pprof external |
| 235 | // interface to the internal interface. |
no outgoing calls
no test coverage detected