GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-golang
/
01_hello
Browse code
add sample
master
1 parent
ee26abe
commit
2f93c97aab551b3a4b735b44c746bf75e53e1ed2
yhornisse
authored
on 2 Oct 2021
Patch
Showing
1 changed file
interface/interface3.go
Ignore Space
Show notes
View
interface/interface3.go
0 → 100644
package main import "fmt" type Piyo struct { Name string } type Hoge interface { Foo() } type Fuga interface { Bar() } type Parent interface { Hoge Fuga } func (p *Piyo) Foo() { fmt.Println("foo") fmt.Println(p) } func (p *Piyo) Bar() { fmt.Println("bar") fmt.Println(p) } func baz(p Parent) { p.Foo() p.Bar() } func main() { v := Piyo{"hoge"} baz(&v) }
Show line notes below