Structures / Methods

type greeting struct {}

func (*greeting) sayGoodby() {
    fmt.Println("Goodby!")
}

g := greeting{}
g.sayGoodby()