You can use len
:
if len(m) == 0 {
....
}
From https://golang.org/ref/spec#Length_and_capacity
len(s) map[K]T map length (number of defined keys)
You can use len
:
if len(m) == 0 {
....
}
From https://golang.org/ref/spec#Length_and_capacity
len(s) map[K]T map length (number of defined keys)