primitive type methods golang code example
Example: golang methods for primitive type
package mainimport "fmt"type Int intfunc (i Int) Add(j Int) Int { return i + j}func main() { i := Int(5) j := Int(6) fmt.Println(i.Add(j)) fmt.Println(i.Add(j) + 12)}