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 interface sample
master
1 parent
77bb1ed
commit
98d6f0bc7d830cc12f0002121649695d1309cb23
yhornisse
authored
on 1 Oct 2021
Patch
Showing
1 changed file
interface/interface.go
Ignore Space
Show notes
View
interface/interface.go
0 → 100644
package main import "fmt" type Hoge struct { Name string } type Parent interface { hoge(b bool) } func (p *Hoge) hoge(b bool) { fmt.Println(p.Name) } func fuga(v Parent) { v.hoge(true) } func main() { v := Hoge{"taro"} fuga(&v) }
Show line notes below