Description

String returns the printed form of this label.

Examples: Object type:

x                                       (a variable)
(sync.Mutex).Lock                       (a function)
convert                                 (array created by conversion)
makemap                                 (map allocated via make)
makechan                                (channel allocated via make)
makeinterface                           (tagged object allocated by makeinterface)
<alloc in reflect.Zero>                 (allocation in instrinsic)
sync.Mutex                              (a reflect.rtype instance)
<command-line arguments>                (an intrinsic object)

Labels within compound objects have subelement paths:

x.y[*].z                                (a struct variable, x)
append.y[*].z                           (array allocated by append)
makeslice.y[*].z                        (array allocated via make)

TODO(adonovan): expose func LabelString(*types.Package, Label).