I'm using bufio.Scanner
, and I'm not sure if I should be giving it a reader wrapped by bufio.Reader
.
I.e., where f
is an os.File
, should I:
scanner := bufio.NewScanner(f)
or
scanner := bufio.NewScanner(bufio.NewReader(f))
I'm using bufio.Scanner
, and I'm not sure if I should be giving it a reader wrapped by bufio.Reader
.
I.e., where f
is an os.File
, should I:
scanner := bufio.NewScanner(f)
or
scanner := bufio.NewScanner(bufio.NewReader(f))
我正在使用 即,其中 或 p >
bufio.Scanner code>,但不确定是否应该 给它一个由
bufio.Reader code>包装的阅读器。 p>
f code>是
os.File code>,我应该: p>
scanner:= bufio.NewScanner(f)
code> pre>
scanner:= bufio.NewScanner(bufio.NewReader(f))
code> pre>
div>