Skip to content

Commit

Permalink
fbb: Adopt the recent lzhuf API change
Browse files Browse the repository at this point in the history
Issue #41
  • Loading branch information
martinhpedersen committed Jul 20, 2016
1 parent fe91210 commit af158b6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fbb/proposal.go
Expand Up @@ -120,15 +120,17 @@ func (p *Proposal) Message() (*Message, error) {
// Data returns the decompressed raw message
func (p *Proposal) Data() []byte {
var r io.ReadCloser
var err error

switch p.code {
case GzipProposal:
var err error
r, err = gzip.NewReader(bytes.NewBuffer(p.compressedData))
if err != nil {
panic(err) //TODO: Should return error
}
default:
r = lzhuf.NewB2Reader(bytes.NewBuffer(p.compressedData))
r, err = lzhuf.NewB2Reader(bytes.NewBuffer(p.compressedData))
}

if err != nil {
panic(err) //TODO: Should return error
}

var buf bytes.Buffer
Expand Down

0 comments on commit af158b6

Please sign in to comment.