title: Querying with an array of arbitrary keys on Google datastore in Golang
body: <p>A continuation from this question:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/29202516/doing-a-in-array-query-on-google-app-engine-datastore-with-golang/29204370#29204370">Doing a &quot;IN Array&quot; query on google app engine datastore with golang</a></p>
  </blockquote>
  
  <p>Right now, I am following the suggestion from the previous question on querying with an array of keys/ids <code>ids []int64</code>. These IDs may or may not actually exist (they have been deleted, but the reference on other instances have not been removed).</p>
  
  <p>My method of trying to obtain these instances looks like so:</p>
  
  <pre><code>var keys []*datastore.Key
  
  for _, id := range ids {
      keys = append(keys, datastore.NewKey(c, "Category", "", id, nil))
  }
  
  categories := make([]Category, len(keys))
  err := datastore.GetMulti(c, keys, categories)
  if err != nil {
      return nil, err
  }
  
  for i := 0; i &lt; len(categories); i++ {
      categories[i].Id = keys[i].IntID()
  }
  </code></pre>
  
  <p>However, it errors out throwing me:</p>
  
  <pre><code>datastore: no such entity
  </code></pre>
  
  <p>I could on the other hand grab each one individually, but is there a more efficient way to approach this?</p>