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
fix and add sample
master
1 parent
d05275c
commit
77bb1ed81e7ea2ec0cec7bc49c236d100dd5e271
yhornisse
authored
on 1 Oct 2021
Patch
Showing
2 changed files
struct/pointer.go
struct/struct3.go
Ignore Space
Show notes
View
struct/pointer.go
0 → 100644
package main import "fmt" type Hoge struct { Name string } func (h Hoge) foo() { fmt.Println(h.Name) } func (p *Hoge) bar() { fmt.Println(p.Name) } func main() { v := Hoge{"hoge"} v.foo() v.bar() }
Ignore Space
Show notes
View
struct/struct3.go
package main import "fmt" type SampleStruct struct { Id int64 Name string } func (p *SampleStruct) hoge() bool { fmt.Println(p.Name) return true } func main() { v := SampleStruct{1, "taro"} v.hoge() }
package main import "fmt" type SampleStruct struct { Id int64 Name string } func (p *SampleStruct) hoge() bool { fmt.Println(p.Name) return true } func main() { v1 := SampleStruct{1, "taro"} v1.hoge() }
Show line notes below