Documentation
¶
Index ¶
- Variables
- func ErrorMessage(message string, err error)
- func InputWithDefaultValue(scanner *bufio.Scanner, message, defaultValue string) string
- func Message(message string)
- func Messagef(format string, a ...interface{})
- func OKMessage(message string)
- func SetCmd(newCommand *cobra.Command)
- func SetTestMode(newTestBuffer *bytes.Buffer)
- func WarningMessage(message string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Green = color.New(color.FgGreen).SprintFunc() Yellow = color.New(color.FgYellow).SprintFunc() Red = color.New(color.FgRed).SprintFunc() Blue = color.New(color.FgBlue).SprintFunc() BlueBoldUnderline = color.New(color.FgBlue, color.Bold, color.Underline).SprintFunc() WhiteBoldUnderline = color.New(color.FgWhite, color.Bold, color.Underline).SprintFunc() )
Colors for terminal output.
Functions ¶
func ErrorMessage ¶
ErrorMessage prints an error message with a red "[Error]" prefix.
func InputWithDefaultValue ¶
InputWithDefaultValue prompts the user for input via terminal and returns the input value or the default value.
func Messagef ¶
func Messagef(format string, a ...interface{})
Messagef prints a formatted message with no prefix.
func OKMessage ¶
func OKMessage(message string)
OKMessage prints a success message with a green "[OK]" prefix.
func SetCmd ¶
SetCmd sets the current command, allowing messages to be printed to the command's output using cmd.Print().
func SetTestMode ¶
SetTestMode sets the terminal to test mode, allowing messages to be printed to a buffer.
func WarningMessage ¶
func WarningMessage(message string)
WarningMessage prints a warning message with a yellow "[Warning]" prefix.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.