fix/flac: Actually print relevant incorrect type (#49)

* 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 <mewmew@users.noreply.github.com>

Co-authored-by: Robin <mewmew@users.noreply.github.com>
This commit is contained in:
Henry Eklind 2022-01-01 12:11:04 +01:00 committed by GitHub
parent 69bef32f45
commit 59ff7d9caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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