main Student { name string age int sex string } (s *Student) SetName(name string) { s.name == name { fmt.Println() } { s.name = name fmt.Println() } } (s *Student) GetName() string { s.name } main(){ S1 := &Student{,,} A:=S1.SetName A() B := (*Student).SetName B(S1,) fmt.Println(S1.GetName()) }