Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
Please refer to Ordered Map in Golang for discussions on ordered maps in Golang.
import "fmt"m := map[string]int {
"how": 1,
"are": 2,
"you": 3,
}
mmap[are:2 how:1 you:3]m["are"]2 trueval, found := m["are"]val2foundtrueIterate a Map¶
ports := map[string]int {
"jupyterlab": 8888,
"jupyterhub": 8000,
"gitpod": 8000,
"vscode": 8080,
}
for prefix, port := range ports {
fmt.Printf("%s: %d\n", prefix, port)
}gitpod: 8000
vscode: 8080
jupyterlab: 8888
jupyterhub: 8000