• Eric Myhre's avatar
    Make the cidlink.Link type only usable as a pointer. · 55dcf0c3
    Eric Myhre authored
    As the comments in the diff say: it's a fairly sizable footgun for
    users to need to consider whether they expect the pointer form or
    the bare form when inspecting what an `ipld.Link` interface contains:
    so, let's just remove the choice.
    
    There's technically no reason for the Link.Load method to need to be
    attached to the pointer receiver other than removing this footgun.
    From the other side, though, there's no reason *not* to make it
    attached to the pointer receiver, because any time a value is assigned
    to an interface type, it necessarily heap-escapes and becomes a pointer
    anyway.  So, making it unconditional and forcing the pointer to be
    clear in the user's hands seems best.
    55dcf0c3
unmarshal.go 5.43 KB