87
87
procCreateConsoleScreenBuffer = kernel32 .NewProc ("CreateConsoleScreenBuffer" )
88
88
)
89
89
90
- // Writer provides colorable Writer to the console
91
- type Writer struct {
90
+ // writer provides colorable Writer to the console
91
+ type writer struct {
92
92
out io.Writer
93
93
handle syscall.Handle
94
94
althandle syscall.Handle
@@ -98,7 +98,7 @@ type Writer struct {
98
98
mutex sync.Mutex
99
99
}
100
100
101
- // NewColorable returns new instance of Writer which handles escape sequence from File.
101
+ // NewColorable returns new instance of writer which handles escape sequence from File.
102
102
func NewColorable (file * os.File ) io.Writer {
103
103
if file == nil {
104
104
panic ("nil passed instead of *os.File to NewColorable()" )
@@ -112,17 +112,17 @@ func NewColorable(file *os.File) io.Writer {
112
112
var csbi consoleScreenBufferInfo
113
113
handle := syscall .Handle (file .Fd ())
114
114
procGetConsoleScreenBufferInfo .Call (uintptr (handle ), uintptr (unsafe .Pointer (& csbi )))
115
- return & Writer {out : file , handle : handle , oldattr : csbi .attributes , oldpos : coord {0 , 0 }}
115
+ return & writer {out : file , handle : handle , oldattr : csbi .attributes , oldpos : coord {0 , 0 }}
116
116
}
117
117
return file
118
118
}
119
119
120
- // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
120
+ // NewColorableStdout returns new instance of writer which handles escape sequence for stdout.
121
121
func NewColorableStdout () io.Writer {
122
122
return NewColorable (os .Stdout )
123
123
}
124
124
125
- // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
125
+ // NewColorableStderr returns new instance of writer which handles escape sequence for stderr.
126
126
func NewColorableStderr () io.Writer {
127
127
return NewColorable (os .Stderr )
128
128
}
@@ -434,7 +434,7 @@ func atoiWithDefault(s string, def int) (int, error) {
434
434
}
435
435
436
436
// Write writes data on console
437
- func (w * Writer ) Write (data []byte ) (n int , err error ) {
437
+ func (w * writer ) Write (data []byte ) (n int , err error ) {
438
438
w .mutex .Lock ()
439
439
defer w .mutex .Unlock ()
440
440
var csbi consoleScreenBufferInfo
0 commit comments