标签:lan ack turn main pack 定义 UNC getname string
package main
import "fmt"
type Student struct {
Num int64
Name string
}
func(s *Student) setName(name string) {
s.Name = name
}
func(s *Student) setNum(num int64) {
s.Num = num
}
func(s *Student) getName() string {
return s.Name
}
func(s *Student) getNum() int64 {
return s.Num
}
func main() {
s := Student{}
s.setName("张三")
s.setNum(123)
fmt.Println(s.getName())
fmt.Println(s.getNum())
}
标签:lan ack turn main pack 定义 UNC getname string
原文地址:https://www.cnblogs.com/zhouyang209117/p/10367963.html