simplify report.MakeFromFile

this new version is less efficient... but not for much longer
This commit is contained in:
Matthias Radestock
2017-11-29 21:47:32 +00:00
parent ecf3ae90ff
commit cdbc01ecf9

View File

@@ -139,21 +139,7 @@ func MakeFromFile(path string) (rpt Report, _ error) {
return rpt, err
}
var buf []byte
if gzipped {
r, err := gzip.NewReader(f)
if err != nil {
return rpt, err
}
buf, err = ioutil.ReadAll(r)
} else {
buf, err = ioutil.ReadAll(f)
}
if err != nil {
return rpt, err
}
err = rpt.ReadBytes(buf, handle)
err = rpt.ReadBinary(f, gzipped, handle)
return rpt, err
}