Check out example codes for "go struct methods". It will help you in understanding the concepts better.
Code Example 1
type Person struct {
name string
surname string
}
func (p Person) GetName() string {
return p.name
}
func (p Person) GetSurname() string {
return p.surname
}
Learn ReactJs, React Native from akashmittal.com