Open lmars opened 7 years ago
I spotted this as I was trying to decode IPLD links into fields of type *cid.Cid, e.g:
*cid.Cid
dec := cbor.NewDecoder(...) dec.TagDecoders[cbornode.CBORTagLink] = &cbornode.IpldLinkDecoder{} dec.Decode(&struct { Link *cid.Cid })
which lead to the following panic:
panic: reflect: call of reflect.Value.Set on zero Value [recovered] panic: reflect: call of reflect.Value.Set on zero Value
Initialising the Link field so that it is not a nil pointer fixes this.
Link
I've also run gofmt on the source files.
gofmt
I spotted this as I was trying to decode IPLD links into fields of type
*cid.Cid
, e.g:which lead to the following panic:
Initialising the
Link
field so that it is not a nil pointer fixes this.I've also run
gofmt
on the source files.