```golang
package main
import "fmt"
func double(x *int) {
*x += *x
x = nil
}
func main() {
var a = 3
double(&a)
fmt.Println(a, &a == nil) // 6 false
fmt.Println("======================")
p := &a
double(p)
fmt.Println(a, p == nil) //12 false
}
```
有疑问加站长微信联系(非本文作者)