package main
import (
"fmt"
)
func main() {
map1 := map[int]string{1: "Golang", 2: "Java", 3: "Python", 4: "C"}
for i, v := range map1 {
fmt.Printf("%d:%s\n",i,v)
}
}
这样是不是更简洁呢
import (
"fmt"
)
func main() {
map1 := map[int]string{1: "Golang", 2: "Java", 3: "Python", 4: "C"}
for i, v := range map1 {
fmt.Printf("%d:%s\n",i,v)
}
}
这样是不是更简洁呢
2020-02-21
linux 下环境变量
1. GOROOT export GOROOT=/usr/local/go
2. GOPATH export GOPATH=~/golib:~/goproject
3. GOBIN export GOBIN=/gobin
4. PATH export PATH=$PATH:$GOROOT/bin:$GOBIN
验证 shell : go version
1. GOROOT export GOROOT=/usr/local/go
2. GOPATH export GOPATH=~/golib:~/goproject
3. GOBIN export GOBIN=/gobin
4. PATH export PATH=$PATH:$GOROOT/bin:$GOBIN
验证 shell : go version
2020-01-14