Skip to content

Commit

Permalink
simplify report.MakeFromFile
Browse files Browse the repository at this point in the history
this new version is less efficient... but not for much longer
  • Loading branch information
rade committed Nov 29, 2017
1 parent ecf3ae9 commit cdbc01e
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions report/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit cdbc01e

Please sign in to comment.