Skip to content

Instantly share code, notes, and snippets.

@joshuaaguilar20
Created September 6, 2019 23:00
Show Gist options
  • Save joshuaaguilar20/f506757ebeb6e5daa8bac8a783e3b94b to your computer and use it in GitHub Desktop.
Save joshuaaguilar20/f506757ebeb6e5daa8bac8a783e3b94b to your computer and use it in GitHub Desktop.
Go Iota
package main
import "fmt"
const (
A0 = iota
A1 = iota
A2 = iota
)
//fmt.Println(C0, C1, C2) // "0 1 2"
//This can be simplified to
const (
C0 = iota
C1
C2
)
func main() {
fmt.Print(C2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment