ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
> ### 方法 method ~~~ package main import "fmt" type Calculation struct { number1 int number2 int } func (c Calculation) Add() int { number3 := c.number1 + c.number2 return number3 } func main() { c := Calculation{7, 8} fmt.Println(c.Add()) } ~~~