瀏覽代碼

inherit io.Writer

mattn 11 年之前
父節點
當前提交
200aed43a9
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      colorable_others.go
  2. 2 1
      colorable_windows.go

+ 2 - 1
colorable_others.go

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

+ 2 - 1
colorable_windows.go

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