Functions and Methods in Go?
type MyInteger int
func (a MyInteger) MyMethod(b int) int {
return a + b
}
// Usage:
// var x MyInteger = 1
// x.MyMethod(2)func (s *MyStruct) pointerMethod() { } // method on pointerfunc (s MyStruct) valueMethod() { } // method on valueLast updated