title: Golang MongoDB using $in operator on list - result argument must be a slice address
body: <p>I have the following Mongo query I'm trying to translate to Go using <code>github.com/globalsign/mgo</code>:</p>
  <pre><code>db.getCollection('cluster').find({&quot;clusterName&quot;: {&quot;$in&quot;: [&quot;clusterA&quot;, &quot;clusterB&quot;]}})
  </code></pre>
  <p>&quot;clusterName&quot; is a string field. Basically the naive alternative would be to perform multiple calls to mongo for each value in the list.</p>
  <p>The query I wrote:</p>
  <pre><code>func ReadClusters(clusterNames []string) (*[]kusto.Cluster, error) {
      var clusters *[]kusto.Cluster
      err := readObjects(clusterCollection, bson.M{&quot;clusterName&quot;: bson.M{&quot;$in&quot;: clusterNames}}, &amp;clusters, &quot;&quot; /* sortField */)
      if err != nil {
          return nil, err
      }
  
      return clusters, nil
  }
  </code></pre>
  <p>And my helper functions:</p>
  <pre><code>func readObjects(collection string, query bson.M, dest interface{}, sortField string) error {
      err := getDocuments(collection, query, dest, sortField)
      if err != nil {
          if err == mgo.ErrNotFound {
              return ErrNotFound
          }
          return err
      }
  
      return nil
  }
  
  func getDocuments(collectionName string, query bson.M, dest interface{}, sortField string) error {
      session := client.Copy()
      defer session.Close()
  
      collection := getCollection(session, collectionName)
      find := collection.Find(query)
  
      if sortField != &quot;&quot; {
          find = find.Sort(sortField)
      }
  
      return find.All(dest)
  }
  </code></pre>
  <p>I'm getting the error:</p>
  <blockquote>
  <p>2020/07/09 11:58:46 http: panic serving [::1]:54085: result argument
  must be a slice address</p>
  </blockquote>
  <p>I'm currently using Go1.11, and the mgo version I see under <code>go.mod</code> is <code>github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8</code></p>