# 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
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gocompiler.shizhz.me/golang-bian-yi-qi-lei-xing-jian-cha/4.4.410-function-method-lei-xing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
