package main
import (
"fmt"
)
const (
monday = 1 + iota
tuesday
wednesday
thursday
friday
saturday
sunday
)
func main() {
fmt.Println(monday, tuesday, wednesday, thursday, friday, saturday, sunday)
}
запускаем, получаем:
1 2 3 4 5 6 7
package main
import (
"fmt"
)
const (
monday = 1 + iota
tuesday
wednesday
thursday
friday
saturday
sunday
)
func main() {
fmt.Println(monday, tuesday, wednesday, thursday, friday, saturday, sunday)
}
запускаем, получаем:
1 2 3 4 5 6 7