type Signature … // NewSignature constructs a Signature. func NewSignature(pkg *types.Package, sig *types.Signature) *Signature { … } // NewSignatureVoid builds the void signature "func()". func NewSignatureVoid() *Signature { … } // LookupSignature returns the signature of the named function in the provided package. func LookupSignature(pkg *types.Package, name string) (*Signature, error) { … } // ParseSignature builds a Signature by parsing a Go function type expression. // The function type must reference builtin types only; see // ParseSignatureInPackage if custom types are required. func ParseSignature(expr string) (*Signature, error) { … } // ParseSignatureInPackage builds a Signature by parsing a Go function type // expression. The expression may reference types in the provided package. func ParseSignatureInPackage(pkg *types.Package, expr string) (*Signature, error) { … } // Params returns the function signature argument types. func (s *Signature) Params() *Tuple { … } // Results returns the function return types. func (s *Signature) Results() *Tuple { … } // Bytes returns the total size of the function arguments and return values. func (s *Signature) Bytes() int { … } // String writes Signature as a string. This does not include the "func" keyword. func (s *Signature) String() string { … } func (s *Signature) init() { … } type Tuple … func newTuple(t *types.Tuple, offsets []int64, size int64, defaultprefix string) *Tuple { … } // Lookup returns the variable with the given name. func (t *Tuple) Lookup(name string) Component { … } // At returns the variable at index i. func (t *Tuple) At(i int) Component { … } // Bytes returns the size of the Tuple. This may include additional padding. func (t *Tuple) Bytes() int { … } func tuplevars(t *types.Tuple) []*types.Var { … } // structsize computes the size of a struct containing the given variables as // fields. It would be equivalent to calculating the size of types.NewStruct(vs, // nil), apart from the fact that NewStruct panics if multiple fields have the // same name, and this happens for example if the variables represent return // types from a function. func structsize(vs []*types.Var) int64 { … }