sync
This commit is contained in:
27
Section4/iota/main.go
Normal file
27
Section4/iota/main.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
const (
|
||||||
|
c1 = iota
|
||||||
|
c2 = iota
|
||||||
|
c3 = iota
|
||||||
|
)
|
||||||
|
fmt.Println(c1, c2, c3)
|
||||||
|
|
||||||
|
const (
|
||||||
|
a = (iota * 2) + 1
|
||||||
|
b
|
||||||
|
c
|
||||||
|
)
|
||||||
|
fmt.Println(a, b, c)
|
||||||
|
|
||||||
|
const (
|
||||||
|
x = -(iota + 2)
|
||||||
|
_
|
||||||
|
y
|
||||||
|
z
|
||||||
|
)
|
||||||
|
fmt.Println(x, y, z)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user