The resolution of types, builtins, constants, is now performed through scopes only, instead of multiple unrelated data structures. The initialization of predefined types, constants and builtins is now done in the global scope (universe block).
26 lines
215 B
Go
26 lines
215 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
const (
|
|
Foo = iota
|
|
Bar
|
|
Baz
|
|
)
|
|
|
|
const (
|
|
Asm = iota
|
|
C
|
|
Java
|
|
Go
|
|
)
|
|
|
|
fmt.Println(Foo, Bar, Baz)
|
|
fmt.Println(Asm, C, Java, Go)
|
|
}
|
|
|
|
// Output:
|
|
// 0 1 2
|
|
// 0 1 2 3
|