How To Check if a Map Contains a Key in Go?

preview_player
Показать описание
Working with maps is a vital part of our everyday routine. So, how should one check if a map contains a key in an idiomatic and concise way for Go?

", ok" is here to help! Check out the video how to use it!
Рекомендации по теме
Комментарии
Автор

You sound a little like pannenkoek2012

Автор

why use ok? make it more concise:

val, exists := userCredentials["Jane"]

notarealperson