Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. 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,
}
m
map[are:2 how:1 you:3]
m["are"]
2 true
val, found := m["are"]
val
2
found
true

Iterate 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