@kjk1/

book iota 5

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

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

import "fmt"

func main() {
	// :show start
	const (
		bit0, mask0 = 1 << iota, 1<<iota - 1 // bit0 == 1, mask0 == 0
		bit1, mask1                          // bit1 == 2, mask1 == 1
		_, _                                 // skips iota == 2
		bit3, mask3                          // bit3 == 8, mask3 == 7
	)
	fmt.Printf("bit0: %d, mask0: 0x%x\n", bit0, mask0)
	fmt.Printf("bit3: %d, mask3: 0x%x\n", bit3, mask3)
	// :show end
}