go check if key exists in map code example Example: go map check key exists if val, ok := dict["foo"]; ok { //do something here }