From 9f2453773e674316eb8d00d4abc34a4a0859fb1b Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sat, 17 Aug 2019 16:49:11 +0900 Subject: [PATCH 1/3] Fix doubled verb --- colorable_windows.go | 2 +- noncolorable.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/colorable_windows.go b/colorable_windows.go index 404e10c..c37f951 100644 --- a/colorable_windows.go +++ b/colorable_windows.go @@ -414,7 +414,7 @@ func doTitleSequence(er *bytes.Reader) error { return nil } -// Write write data on console +// Write data on console func (w *Writer) Write(data []byte) (n int, err error) { var csbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) diff --git a/noncolorable.go b/noncolorable.go index 9721e16..a4b2c8d 100644 --- a/noncolorable.go +++ b/noncolorable.go @@ -15,7 +15,7 @@ func NewNonColorable(w io.Writer) io.Writer { return &NonColorable{out: w} } -// Write write data on console +// Write data on console func (w *NonColorable) Write(data []byte) (n int, err error) { er := bytes.NewReader(data) var bw [1]byte From 10fba6843c181049d2ed851e6392bf5e9f98a68e Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sun, 18 Aug 2019 05:35:15 +0900 Subject: [PATCH 2/3] Add s to a verb, write --- colorable_windows.go | 2 +- noncolorable.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/colorable_windows.go b/colorable_windows.go index c37f951..37b2d39 100644 --- a/colorable_windows.go +++ b/colorable_windows.go @@ -414,7 +414,7 @@ func doTitleSequence(er *bytes.Reader) error { return nil } -// Write data on console +// Write writes data on console func (w *Writer) Write(data []byte) (n int, err error) { var csbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) diff --git a/noncolorable.go b/noncolorable.go index a4b2c8d..54f96ce 100644 --- a/noncolorable.go +++ b/noncolorable.go @@ -15,7 +15,7 @@ func NewNonColorable(w io.Writer) io.Writer { return &NonColorable{out: w} } -// Write data on console +// Write writes data on console func (w *NonColorable) Write(data []byte) (n int, err error) { er := bytes.NewReader(data) var bw [1]byte From db913df07236cee5ac0a8bac37c88b2751b1e41c Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sun, 18 Aug 2019 05:43:38 +0900 Subject: [PATCH 3/3] [ci skip]Add third person singular `s` in comments --- colorable_appengine.go | 6 +++--- colorable_others.go | 6 +++--- colorable_windows.go | 8 ++++---- noncolorable.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/colorable_appengine.go b/colorable_appengine.go index 1f28d77..0b0aef8 100644 --- a/colorable_appengine.go +++ b/colorable_appengine.go @@ -9,7 +9,7 @@ import ( _ "github.com/mattn/go-isatty" ) -// NewColorable return new instance of Writer which handle escape sequence. +// NewColorable returns new instance of Writer which handles escape sequence. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -18,12 +18,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return os.Stdout } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return os.Stderr } diff --git a/colorable_others.go b/colorable_others.go index 887f203..3fb771d 100644 --- a/colorable_others.go +++ b/colorable_others.go @@ -10,7 +10,7 @@ import ( _ "github.com/mattn/go-isatty" ) -// NewColorable return new instance of Writer which handle escape sequence. +// NewColorable returns new instance of Writer which handles escape sequence. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -19,12 +19,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return os.Stdout } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return os.Stderr } diff --git a/colorable_windows.go b/colorable_windows.go index 37b2d39..a4b3209 100644 --- a/colorable_windows.go +++ b/colorable_windows.go @@ -81,7 +81,7 @@ var ( procCreateConsoleScreenBuffer = kernel32.NewProc("CreateConsoleScreenBuffer") ) -// Writer provide colorable Writer to the console +// Writer provides colorable Writer to the console type Writer struct { out io.Writer handle syscall.Handle @@ -91,7 +91,7 @@ type Writer struct { rest bytes.Buffer } -// NewColorable return new instance of Writer which handle escape sequence from File. +// NewColorable returns new instance of Writer which handles escape sequence from File. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -106,12 +106,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return NewColorable(os.Stdout) } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return NewColorable(os.Stderr) } diff --git a/noncolorable.go b/noncolorable.go index 54f96ce..95f2c6b 100644 --- a/noncolorable.go +++ b/noncolorable.go @@ -5,12 +5,12 @@ import ( "io" ) -// NonColorable hold writer but remove escape sequence. +// NonColorable holds writer but removes escape sequence. type NonColorable struct { out io.Writer } -// NewNonColorable return new instance of Writer which remove escape sequence from Writer. +// NewNonColorable returns new instance of Writer which removes escape sequence from Writer. func NewNonColorable(w io.Writer) io.Writer { return &NonColorable{out: w} }