789d77a cmd/link: propagate UsedInIface through method descriptor

Authored and Committed by Cherry Zhang 3 years ago
    cmd/link: propagate UsedInIface through method descriptor
    
    The linker prunes methods that are not directly reachable if the
    receiver type is never converted to interface. A type can be
    converted to interface using reflection through other types.
    The linker already takes this into consideration but it missed
    the case that the intermediate is a method descriptor. Handle
    this case.
    
    Change-Id: I590efc5da163c326db8d43583908a2ef67f65d9d
    Reviewed-on: https://go-review.googlesource.com/c/go/+/255858
    Trust: Cherry Zhang <cherryyz@google.com>
    Run-TryBot: Cherry Zhang <cherryyz@google.com>
    TryBot-Result: Go Bot <gobot@golang.org>
    Reviewed-by: Than McIntosh <thanm@google.com>
    Reviewed-by: Jeremy Faller <jeremy@golang.org>