Documentation
¶
Overview ¶
Package provides ability to print colored text on stdout
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Out io.Writer
Will be used as first argument of fmt.Fprintln so with this you are able to redirect output stream
Functions ¶
This section is empty.
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
func Print ¶
Provide text for printing
Example (In) ¶
package main import ( cli "github.com/ivpusic/go-clicolor/clicolor" ) func main() { cli.Print("this is green text").In("green") // prints: this is green text }
Output:
Example (InFormat) ¶
package main import ( cli "github.com/ivpusic/go-clicolor/clicolor" ) func main() { cli.Print("{red}Some text in red. {white}Some text in white. {default}Some text in default color.").InFormat() // prints: Some text in red. Some text in white. Some text in default color. }
Output:
Click to show internal directories.
Click to hide internal directories.