From 7b19e81fc64ff38baeb56b4f37348723ad516f2a Mon Sep 17 00:00:00 2001 From: YenForYang Date: Fri, 17 Sep 2021 21:44:47 -0500 Subject: [PATCH] bencode: get type of `big.Int` without creating instance (#651) Nope, it doesn't really matter. But anyway, see https://github.com/golang/crypto/blob/c084706c2272f3d44b722e988e70d4a58e60e7f4/cryptobyte/asn1.go#L267 --- bencode/encode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bencode/encode.go b/bencode/encode.go index 05153a8c..4c7c8602 100644 --- a/bencode/encode.go +++ b/bencode/encode.go @@ -96,7 +96,7 @@ func (e *Encoder) reflectMarshaler(v reflect.Value) bool { return true } -var bigIntType = reflect.TypeOf(big.Int{}) +var bigIntType = reflect.TypeOf((*big.Int)(nil)).Elem() func (e *Encoder) reflectValue(v reflect.Value) {