Tag: 指针

Golang 方法中指针传值的陷阱

Jackey Golang 2,979 次浏览 ,
package main import "fmt" type Person struct { Name string } func (p Person) test1() { p.Name = "www.gopher.cc" fmt.Println(p.Name) } func (p *Person) test2() { p.Name = "www.gopher.cc" ...
Go