1
0
Fork 0
mirror of https://github.com/actions/go-versions synced 2024-11-08 22:52:38 +00:00
go-versions/tests/source/maps/maps.go
2020-06-09 22:52:06 +03:00

27 lines
No EOL
388 B
Go

package main
import "fmt"
func main() {
m := make(map[string]int)
m["k1"] = 7
m["k2"] = 13
fmt.Println("map:", m)
v1 := m["k1"]
fmt.Println("v1: ", v1)
fmt.Println("len:", len(m))
delete(m, "k2")
fmt.Println("map:", m)
_, prs := m["k2"]
fmt.Println("prs:", prs)
n := map[string]int{"foo": 1, "bar": 2}
fmt.Println("map:", n)
}