Skip to content

Commit

Permalink
fix/flac: Actually print relevant incorrect type (#49)
Browse files Browse the repository at this point in the history
* fix/flac: Actually print relevant incorrect type

`si` will always be `(*meta.StreamInfo)`, the relevant type is
`block.Header.Type` which implements `Stringer`

* Update flac.go

Co-authored-by: Robin <[email protected]>

Co-authored-by: Robin <[email protected]>
  • Loading branch information
karlek and mewmew authored Jan 1, 2022
1 parent 69bef32 commit 59ff7d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flac.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 184,7 @@ func (stream *Stream) parseStreamInfo() (block *meta.Block, err error) {
}
si, ok := block.Body.(*meta.StreamInfo)
if !ok {
return block, fmt.Errorf("flac.parseStreamInfo: incorrect type of first metadata block; expected *meta.StreamInfo, got %T", si)
return block, fmt.Errorf("flac.parseStreamInfo: incorrect type of first metadata block; expected *meta.StreamInfo, got %T", block.Body)
}
stream.Info = si
return block, nil
Expand Down

0 comments on commit 59ff7d9

Please sign in to comment.