output

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Verbose can be set to show debug lines
	Verbose bool
)

Functions

func Confirm

func Confirm(def bool, format string, a ...interface{}) bool

Confirm will prompt the user to enter yes or no, returning the result.

func Debug

func Debug(format string, a ...interface{})

Debug will output only if the Verbose flag is set.

func Fatal

func Fatal(format string, a ...interface{})

Fatal exists with status code 1 after printing the line in red

func InfoLn

func InfoLn(format string, a ...interface{})

InfoLn prints the string on its own line without returning an Operation.

Types

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

Operation represents something currently happening that can be completed, failed or abandoned.

func Info

func Info(format string, a ...interface{}) *Operation

Info prints the string and returns an Operation that can be used to control whether a check mark or ballot x is placed at the end of the line.

func (*Operation) Abandon

func (o *Operation) Abandon()

Abandon just prints a new line without a symbol

func (*Operation) Failed

func (o *Operation) Failed()

Failed prints a heavy ballot X and a new line

func (*Operation) Success

func (o *Operation) Success(args ...interface{})

Success prints the result of running fmt.Sprintf on args and a new line. If args is empty then a default check mark is used.

Jump to

Keyboard shortcuts

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