Equal compares string maps for equality, regardless of order. Note that it treats a nil map as equal to an empty (but not nil) map.
(a, b map[string]string)
| 26 | // Equal compares string maps for equality, regardless of order. Note that it treats |
| 27 | // a nil map as equal to an empty (but not nil) map. |
| 28 | func Equal(a, b map[string]string) bool { |
| 29 | if len(a) != len(b) { |
| 30 | return false |
| 31 | } |
| 32 | for k, v := range a { |
| 33 | if bval, ok := b[k]; !ok || bval != v { |
| 34 | return false |
| 35 | } |
| 36 | } |
| 37 | return true |
| 38 | } |
no outgoing calls