Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Last active January 10, 2019 14:12
Show Gist options
  • Select an option

  • Save ashkrit/2d7eb4e97c2f0183235e3f820204fe83 to your computer and use it in GitHub Desktop.

Select an option

Save ashkrit/2d7eb4e97c2f0183235e3f820204fe83 to your computer and use it in GitHub Desktop.
//Create Alias for int type
type RichInt int
func main() {
var ri RichInt
ri = 100
fmt.Println("Value of rich int", ri)
fmt.Println("Convert to Int", int(ri))
fmt.Println("From int to Rich Int", RichInt(100))
fmt.Println("Binary Value", ri.toBinary())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment