From e60b36751c44adcdb0590641fb4ef9cc3d55c49a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 30 Jul 2019 21:33:52 -0700 Subject: [PATCH] tlv: display the unknown primitive type in MakePrimitiveRecord error message --- tlv/record.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tlv/record.go b/tlv/record.go index 923d70fa..cad51379 100644 --- a/tlv/record.go +++ b/tlv/record.go @@ -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{