title: Golang,MongoDB, Having issues using $in to find all elements with one string in there array property
body: <p>I am trying to find all users in a MongoDB collection that contains a  username string in the friends array. I am using Golang with the mgo driver. </p>
  
  <pre><code>   type User struct {
      ...
          Friends        []string    `json: friends bson:"friends,omitempty"` 
      ...
      }
  
      ...
      // username is a string
      arr := []string{username}
  
      err := c.Find(bson.M{"friends": {"$in": arr}}).All(&amp;users)
      ...
  </code></pre>
  
  <p>I get this error:
  http: panic serving [::1]:56358: assignment to entry in nil map</p>
  
  <p>Any help would be greatly appreciated.</p>