I know I can iterate over a map m by,
for k, v := range m { ... }
and look for a key but is there a more efficient way of testing a key's existence in a map? Thanks. I couldn't find an answer in the language spec.
转载于:https://stackoverflow.com/questions/2050391/how-to-check-if-a-map-contains-a-key-in-go