chore: fix warnings (#3989)
This commit is contained in:
@@ -2,7 +2,7 @@ package iox
|
||||
|
||||
import "os"
|
||||
|
||||
// RedirectInOut redirects stdin to r, stdout to w, and callers need to call restore afterwards.
|
||||
// RedirectInOut redirects stdin to r, stdout to w, and callers need to call restore afterward.
|
||||
func RedirectInOut() (restore func(), err error) {
|
||||
var r, w *os.File
|
||||
r, w, err = os.Pipe()
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
const bufSize = 32 * 1024
|
||||
|
||||
// CountLines returns the number of lines in file.
|
||||
// CountLines returns the number of lines in the file.
|
||||
func CountLines(file string) (int, error) {
|
||||
f, err := os.Open(file)
|
||||
if err != nil {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// A TextLineScanner is a scanner that can scan lines from given reader.
|
||||
// A TextLineScanner is a scanner that can scan lines from the given reader.
|
||||
type TextLineScanner struct {
|
||||
reader *bufio.Reader
|
||||
hasNext bool
|
||||
@@ -14,7 +14,7 @@ type TextLineScanner struct {
|
||||
err error
|
||||
}
|
||||
|
||||
// NewTextLineScanner returns a TextLineScanner with given reader.
|
||||
// NewTextLineScanner returns a TextLineScanner with the given reader.
|
||||
func NewTextLineScanner(reader io.Reader) *TextLineScanner {
|
||||
return &TextLineScanner{
|
||||
reader: bufio.NewReader(reader),
|
||||
|
||||
Reference in New Issue
Block a user