re3*_*3el 1 pointers go
te10
package main
import (
"fmt"
)
func another(te *interface{}) {
*te = check{Val: 10}
}
func some(te *interface{}) {
*te = check{Val: 20}
another(te)
}
type check struct {
Val int
}
func main() {
a := check{Val: 100}
p := &a
fmt.Println(*p)
some(p)
fmt.Println(*p)
}
谢谢!
PS我已经读过,传递指向接口的指针不是一个很好的做法.请告诉我什么是更好的方法来处理它