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() }