print

package
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package print defines functions to accept colored standard output and user input

Index

Constants

This section is empty.

Variables

View Source
var (
	// Stdout is new instance of Writer which handles escape sequence for stdout.
	Stdout = colorable.NewColorableStdout()
	// Stderr is new instance of Writer which handles escape sequence for stderr.
	Stderr = colorable.NewColorableStderr()
)
View Source
var FmtScanln = fmt.Scanln

FmtScanln is wrapper for fmt.Scanln(). It's for unit test.

View Source
var OsExit = os.Exit

OsExit is wrapper for os.Exit(). It's for unit test.

Functions

func Err

func Err(err interface{})

Err print error message at STDERR in yellow. This function is used to print error message to the user.

func Fatal

func Fatal(err interface{})

Fatal print dying message at STDERR in red. After print message, process will exit

func Info

func Info(msg string)

Info print information message at STDOUT in green. This function is used to print some information (that is not error) to the user.

func Question added in v0.6.0

func Question(ask string) bool

Question displays the question in the terminal and receives an answer from the user.

func Warn

func Warn(err interface{})

Warn print warning message at STDERR in yellow. This function is used to print warning message to the user.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL