mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 12:31:02 +01:00
11 lines
177 B
Go
11 lines
177 B
Go
|
|
package app
|
||
|
|
|
||
|
|
// look if a key in a map exists, generic variant
|
||
|
|
func Exists[K comparable, V any](m map[K]V, v K) bool {
|
||
|
|
if _, ok := m[v]; ok {
|
||
|
|
return true
|
||
|
|
}
|
||
|
|
|
||
|
|
return false
|
||
|
|
}
|