20 lines
292 B
Go
20 lines
292 B
Go
// Ok Guard
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
x := make(map[string]string)
|
|
x["here"] = "yes"
|
|
|
|
if name, ok := x["?"]; ok {
|
|
fmt.Println(name)
|
|
} else {
|
|
fmt.Println("miss")
|
|
}
|
|
|
|
if name, ok := x["here"]; ok {
|
|
fmt.Println(name)
|
|
}
|
|
}
|