gobuch/best-practices/map-contains/main.go

15 lines
170 B
Go
Raw Permalink Normal View History

2020-08-21 04:26:40 +00:00
package main
import "fmt"
func main() {
m := make(map[string]string)
m["key1"] = "value1"
if v, ok := m["key2"]; ok {
fmt.Printf("Wert %v enthalten\n", v)
}
}