mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-17 12:51:01 +00:00
Read one line for empty strings
This commit is contained in:
parent
15055440da
commit
b23c507af5
1 changed files with 4 additions and 0 deletions
|
|
@ -70,6 +70,10 @@ func NewLineArray(reader io.Reader) *LineArray {
|
|||
var buf bytes.Buffer
|
||||
tee := io.TeeReader(reader, &buf)
|
||||
numlines, _ := lineCounter(tee)
|
||||
if numlines == 0 {
|
||||
numlines = 1
|
||||
}
|
||||
|
||||
la.lines = make([]Line, numlines)
|
||||
|
||||
br := bufio.NewReader(&buf)
|
||||
|
|
|
|||
Loading…
Reference in a new issue