title: How to write a function that accepts any map
body: <p>I tried writing this:</p>
  
  <pre><code>func KeyExists(m map[interface{}]interface{}, k interface{}) bool {
      if _, ok := m[k]; ok {
          return true
      }
      return false
  }
  </code></pre>
  
  <p>When trying to run this with an <code>m[int]int</code>, I get: </p>
  
  <pre><code>cannot use xxx (type map[int]int) as type map[interface {}]interface {} in argument to KeyExists
  </code></pre>
  
  <p>Why? From this: <a href="https://stackoverflow.com/questions/40145569/how-do-you-make-a-function-accept-multiple-types-in-go">How do you make a function accept multiple types in go?</a>
  I infer that interface{} should work here. </p>
  
  <p>The error message is half helpful and half annoying, since it states I cannot do something but not why. </p>