package main
import "fmt"
type Student struct {
Name string
}
func (s Student) test01() {
fmt.Println(s.Name)
}
func method01(s Student) {
fmt.Println(s.Name)
}
func main() {
// 方法需要绑定指定的数据类型
// 函数不需要
// 函数名(实参列表)
// 变量.方法名(实参列表)
var s Student = Student{"张三"}
// 调用函数
method01(s)
// 调用方法
s.test01()
}