Fundamentals9 / 10
Up next

const and iota

package main

import "fmt"

// iota auto-increments within a const block, starting at 0
const (
	Red = iota
	Green
	Blue
)

const MaxRetries = 3

func main() {
	fmt.Println(Red, Green, Blue, MaxRetries)
}
What you're solving

grouped constants numbered by iota