func init() { … } type readlineUI … func newReadlineUI() driver.UI { … } // ReadLine returns a line of text (a command) read from the user. // prompt is printed before reading the command. func (r *readlineUI) ReadLine(prompt string) (string, error) { … } // Print shows a message to the user. // It formats the text as fmt.Print would and adds a final \n if not already present. // For line-based UI, Print writes to standard error. // (Standard output is reserved for report data.) func (r *readlineUI) Print(args ...any) { … } // PrintErr shows an error message to the user. // It formats the text as fmt.Print would and adds a final \n if not already present. // For line-based UI, PrintErr writes to standard error. func (r *readlineUI) PrintErr(args ...any) { … } func (r *readlineUI) print(withColor bool, args ...any) { … } // colorize prints the msg in red using ANSI color escapes. func colorize(msg string) string { … } // IsTerminal reports whether the UI is known to be tied to an // interactive terminal (as opposed to being redirected to a file). func (r *readlineUI) IsTerminal() bool { … } // WantBrowser indicates whether browser should be opened with the -http option. func (r *readlineUI) WantBrowser() bool { … } // SetAutoComplete instructs the UI to call complete(cmd) to obtain // the auto-completion of cmd, if the UI supports auto-completion at all. func (r *readlineUI) SetAutoComplete(complete func(string) string) { … }