@kjk1/

book iota 3

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9212065464421115","path":"main.go","file":{"path":"main.go","content":{"asEncoding":{"base64":"cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCmZ1bmMgbWFpbigpIHsKCS8vIDpzaG93IHN0YXJ0Cgljb25zdCAoIC8vIGlvdGEgaXMgcmVzZXQgdG8gMAoJCWEgPSAxIDw8IGlvdGEgLy8gYSA9PSAxCgkJYiA9IDEgPDwgaW90YSAvLyBiID09IDIKCQljID0gMyAgICAgICAgIC8vIGMgPT0gMyAgKGlvdGEgaXMgbm90IHVzZWQgYnV0IHN0aWxsIGluY3JlbWVudGVkKQoJCWQgPSAxIDw8IGlvdGEgLy8gZCA9PSA4CgkpCglmbXQuUHJpbnRmKCJhOiAlZCwgYjogJWQsIGM6ICVkLCBkOiAlZFxuIiwgYSwgYiwgYywgZCkKCS8vIDpzaG93IGVuZAp9Cg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main

import "fmt"

func main() {
	// :show start
	const ( // iota is reset to 0
		a = 1 << iota // a == 1
		b = 1 << iota // b == 2
		c = 3         // c == 3  (iota is not used but still incremented)
		d = 1 << iota // d == 8
	)
	fmt.Printf("a: %d, b: %d, c: %d, d: %d\n", a, b, c, d)
	// :show end
}