Skip to content

Instantly share code, notes, and snippets.

@kylelemons
Created July 9, 2010 02:58
Show Gist options
  • Save kylelemons/468973 to your computer and use it in GitHub Desktop.
Save kylelemons/468973 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type myInt int
func (i myInt) square() myInt {
return i*i
}
func main() {
fmt.Println(myInt(6).square())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment