https://groups.google.com/g/golang-china/c/xz9JdKqHi-c
func fn() *int {
a := 10
return &a
}
type Config struct {
val int
str string
}
func fn2() *Config {
b := &Config{val: 5,
str: "ni"}
return b
}
func main() {
x2 := fn2()
x3 := fn2()
fmt.Println("x address:", x2)
fmt.Println("x=", *x2)
fmt.Println("x address:", x3)
fmt.Println("x=", *x3)
x := fn()
y := fn()
fmt.Println("x address:", x)
fmt.Println("x=", *x)
fmt.Println("y address:", y)
fmt.Println("y=", *y)
}