Skip to content

xyproto/textoutput

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cmd
 
 
img
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TextOutput

Build Status GoDoc License Go Report Card

Package for controlling text output, with or without colors, on Linux, using VT100 terminal codes.

Example use

package main

import (
    "github.com/xyproto/textoutput"
)

func main() {
    // Prepare to output colored text, but respect the NO_COLOR environment variable
    o := textoutput.New()

    o.Print("<blue>hi</blue> ")
    o.Println("<yellow>there</yellow>")
    o.Printf("<green>%s: <red>%d<off>\n", "number", 42)
}

screenshot

General info

About

🅰️ Output text, with and without colors

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages