Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FuncName ¶
type FuncName struct {
// Path is the package path (e.g. "encoding/json").
Path string
// LocalFuncName is the package-local part (receiver and name).
LocalFuncName
}
FuncName represents the fully qualified name of a function or method: Package path, receiver type, and function name, ignoring type parameters.
func FuncNameOf ¶
FuncNameOf extracts the name components of a given *types.Func. It populates a FuncName struct, which is simplified and canonicalized from fun.Fullname() and can then be used as a map index or to get a string representation.
func (FuncName) AppendText ¶
AppendText implements encoding.TextAppender.
func (FuncName) Compare ¶
Compare compares two FuncName instances lexicographically. It first compares by Path, and if they are equal, it compares by Receiver/Name.
func (FuncName) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (FuncName) String ¶
String returns the fully qualified function name as a string.
The string representation uses parentheses around the receiver to avoid ambiguity: `(encoding/json.Decoder).Decode` for methods vs. `encoding/json.Unmarshal` for functions.
func (*FuncName) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type LocalFuncName ¶
type LocalFuncName struct {
// Receiver is the name of the receiver type (e.g. "Decoder").
// It is empty for regular functions.
Receiver string
// Name is the function or method name (e.g. "Decode").
Name string
}
LocalFuncName is a package-local name of a function or method.
func (LocalFuncName) AppendText ¶
func (l LocalFuncName) AppendText(buf []byte) ([]byte, error)
AppendText implements encoding.TextAppender.
func (LocalFuncName) Compare ¶
func (l LocalFuncName) Compare(other LocalFuncName) int
Compare compares two LocalFuncName instances lexicographically by Receiver, then Name.
func (LocalFuncName) MarshalText ¶
func (l LocalFuncName) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (LocalFuncName) String ¶
func (l LocalFuncName) String() string
String returns the local function name as a string.
Since there is no package path, there is no ambiguity: the format is simply "Receiver.Name" for methods and "Name" for functions.
func (*LocalFuncName) UnmarshalText ¶
func (l *LocalFuncName) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type RenameMap ¶
type RenameMap map[LocalFuncName]map[string][]string
RenameMap is a map of local function names and identifiers to new identifier names.