> For the complete documentation index, see [llms.txt](https://gocompiler.shizhz.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gocompiler.shizhz.me/golang-bian-yi-qi-lei-xing-jian-cha/4.4.410-function-method-lei-xing.md).

# 4.4.4-10 Function & Method 类型

函数与方法的类型使用同一个结构来表示，其定义如下：

```go
type Signature struct {
	rparams  []*TypeName // 如果是方法，存放 receiver 的泛型列表
	tparams  []*TypeName // 存放方法的泛型列表
	scope    *Scope      // 函数所在的作用域
	recv     *Var        // 如果是方法，则存放 receiver, 否则为 nil
	params   *Tuple      // 参数类型列表
	results  *Tuple      // 返回值类型列表
	variadic bool        // 如果左右一个是变长参数（...T），则为 true
}
```
