diff --git a/go/type.go b/go/type.go index 50a1fcc..8971f41 100644 --- a/go/type.go +++ b/go/type.go @@ -180,10 +180,10 @@ func NewStringReader(lines []string) *StringReader { func (self *StringReader) __init__(lines []string) { size := 0 for _, l := range lines { - size += len(l) + size += len(l) + 1 // +1 for EOL } self.buf = make([]string, 0, size) - self.pos = make([]pos, 0, size) + self.pos = make([]pos, 0, size+1) // +1 for EOF var lnum = 0 for lnum < len(lines) { var col = 0