colorable_others.go 323 B

123456789101112131415161718192021222324
  1. // +build !windows
  2. package colorable
  3. import (
  4. "io"
  5. "os"
  6. )
  7. func NewColorable(file *os.File) io.Writer {
  8. if file == nil {
  9. panic("nil passed instead of *os.File to NewColorable()")
  10. }
  11. return file
  12. }
  13. func NewColorableStdout() io.Writer {
  14. return os.Stdout
  15. }
  16. func NewColorableStderr() io.Writer {
  17. return os.Stderr
  18. }