gobuch/golang-language-samples/pointer-parameter/pointer.go
2020-08-21 06:26:40 +02:00

21 lines
211 B
Go

package main
import "fmt"
type Person struct {
Name string
}
func sayHello(p interface{}) {
t, ok := p.(*Person)
fmt.Println(t)
fmt.Println(ok)
}
func main() {
p := &Person{"Kristian"}
sayHello(p)
}