Documentation
¶
Overview ¶
Package iprint contains helper functions for printing information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunDurationString ¶
RunDurationString returns a calculated duration used to indicate how long a particular Task (or set of Tasks) took to run.
Types ¶
type AllColors ¶
type AllColors struct {
Reset string
Red string
Green string
Yellow string
Blue string
Magenta string
Cyan string
Gray string
White string
DebugColor string
InfoColor string
WarnColor string
ErrorColor string
GoodColor string
}
AllColors holds All the possible ANSI color codes that can be used. See the topmost comment in this file for "why".
func Colors ¶
func Colors() AllColors
Colors returns a populated AllColors. It can be used to grab a conditional ANSI color code in message-printing.
For example, to override a print function's default text color with, say, red, you could do something like this:
fmt.Println(iprint.Colors().Red + "oops" + iprint.Colors().Reset)
Click to show internal directories.
Click to hide internal directories.