@kjk1/

book iota 2

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

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

import "fmt"

func main() {
	// :show start
	const (
		Secure = 1 << iota // 0b001
		Authn              // 0b010
		Ready              // 0b100
	)

	ConnState := Secure | Authn // 0b011: Connection is secure and authenticated, but not yet Ready

	fmt.Printf("Secure: 0x%x (0b%03b)\nAuthn: 0x%x (0b%03b)\nConnState: 0x%x (0b%03b)\n", Secure, Secure, Authn, Authn, ConnState, ConnState)
	// :show end
}