Skip to content

Instantly share code, notes, and snippets.

@nanoninja
Created May 24, 2015 10:36
Show Gist options
  • Save nanoninja/b977b96361cfec6d3054 to your computer and use it in GitHub Desktop.
Save nanoninja/b977b96361cfec6d3054 to your computer and use it in GitHub Desktop.
Go Number Type
type Number float64
func (n *Number) Increase() {
*n++
}
func (n *Number) Decrease() {
*n--
}
func (n *Number) Double() {
*n *= 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment