Explorar el Código

inherit io.Writer

mattn hace 11 años
padre
commit
200aed43a9
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 2 1
      colorable_others.go
  2. 2 1
      colorable_windows.go

+ 2 - 1
colorable_others.go

@@ -3,9 +3,10 @@
 package colorable
 
 import (
+	"io"
 	"os"
 )
 
-func NewColorableWriter() *Writer {
+func NewColorableStdout() io.Writer {
 	return os.Stdout
 }

+ 2 - 1
colorable_windows.go

@@ -3,6 +3,7 @@ package colorable
 import (
 	"bytes"
 	"fmt"
+	"io"
 	"os"
 	"strconv"
 	"strings"
@@ -59,7 +60,7 @@ type Writer struct {
 	lastbuf bytes.Buffer
 }
 
-func NewColorableWriter() *Writer {
+func NewColorableStdout() io.Writer {
 	return &Writer{out: syscall.Handle(os.Stdout.Fd())}
 }