aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattn/go-colorable/colorable_others.go
blob: a7fe19a8ca0fe140b4a656ba57e2ab6d9608bc26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// +build !windows

package colorable

import (
    "io"
    "os"
)

// NewColorable return new instance of Writer which handle escape sequence.
func NewColorable(file *os.File) io.Writer {
    if file == nil {
        panic("nil passed instead of *os.File to NewColorable()")
    }

    return file
}

// NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
func NewColorableStdout() io.Writer {
    return os.Stdout
}

// NewColorableStderr return new instance of Writer which handle escape sequence for stderr.
func NewColorableStderr() io.Writer {
    return os.Stderr
}