mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-07-21 07:30:44 +02:00
initial import
This commit is contained in:
20
golang-language-samples/pointer-parameter/pointer.go
Normal file
20
golang-language-samples/pointer-parameter/pointer.go
Normal file
@ -0,0 +1,20 @@
|
||||
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)
|
||||
|
||||
}
|
Reference in New Issue
Block a user