Skip to content
🅰️ Output text, with and without colors
Go
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
img
vendor
.gitignore
.travis.yml
LICENSE
README.md
go.mod
go.sum
textoutput.go
textoutput_test.go

README.md

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

You can’t perform that action at this time.