lsif parser should not buffer zip files in memory
This is a corrective action from gitlab-com/gl-infra/production#2581 (closed)
From parser.ZipReader
:
func (p *Parser) ZipReader() (io.Reader, error) {
buf := new(bytes.Buffer)
w := zip.NewWriter(buf)
if err := p.Docs.SerializeEntries(w); err != nil {
return nil, err
}
if err := w.Close(); err != nil {
return nil, err
}
return buf, nil
}
We should remove the bytes.Buffer
allocation and make use of io.Pipe()
instead.
/cc @igor.drozdov @jacobvosmaer-gitlab @igorwwwwwwwwwwwwwwwwwwww