tlv: display the unknown primitive type in MakePrimitiveRecord error message

This commit is contained in:
Olaoluwa Osuntokun 2019-07-30 21:33:52 -07:00
parent aea529d9f6
commit e60b36751c
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

View File

@ -1,6 +1,7 @@
package tlv
import (
"fmt"
"io"
"github.com/btcsuite/btcd/btcec"
@ -126,7 +127,7 @@ func MakePrimitiveRecord(typ Type, val interface{}) Record {
decoder = DVarBytes
default:
panic("unknown primitive type")
panic(fmt.Sprintf("unknown primitive type: %T", val))
}
return Record{