package main
import (
"fmt"
)
func main() {
mymap := map[string]int{
"Tivi": 230,
"Laptop": 1200,
"Mobile": 500,
"Computer": 98,
}
value, ok := mymap["Tivi"]
if ok {
fmt.Println("value: ", value)
} else {
fmt.Println("Key not found")
}
}
Output
value: 230