You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

colorable_appengine.go 625B

1234567891011121314151617181920212223242526272829
  1. // +build appengine
  2. package colorable
  3. import (
  4. "io"
  5. "os"
  6. _ "github.com/mattn/go-isatty"
  7. )
  8. // NewColorable returns new instance of Writer which handles escape sequence.
  9. func NewColorable(file *os.File) io.Writer {
  10. if file == nil {
  11. panic("nil passed instead of *os.File to NewColorable()")
  12. }
  13. return file
  14. }
  15. // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
  16. func NewColorableStdout() io.Writer {
  17. return os.Stdout
  18. }
  19. // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
  20. func NewColorableStderr() io.Writer {
  21. return os.Stderr
  22. }