var terminalEscaper … // WriteEscaped replaces unsafe terminal characters with replacement strings // and writes them to the given writer. func WriteEscaped(writer io.Writer, output string) error { … } // EscapeTerminal escapes terminal special characters in a human readable (but // non-reversible) format. func EscapeTerminal(in string) string { … } // IsTerminal returns whether the passed object is a terminal or not func IsTerminal(i interface{ … } // AllowsColorOutput returns true if the specified writer is a terminal and // the process environment indicates color output is supported and desired. func AllowsColorOutput(w io.Writer) bool { … }