code: func GetGatewaysForIDs(db sqlx.Queryer, ids []lorawan.EUI64) (map[lorawan.EUI64]Gateway, error) {
  	out := make(map[lorawan.EUI64]Gateway)
  	var idsB [][]byte
  	for i := range ids {
  		idsB = append(idsB, ids[i][:])
  	}
  
  	var gws []Gateway
  	err := sqlx.Select(db, &gws, "select * from gateway where gateway_id = any($1)", pq.ByteaArray(idsB))
  	if err != nil {
  		return nil, handlePSQLError(err, "select error")
  	}
  
  	if len(gws) != len(ids) {
  		return nil, fmt.Errorf("expected %d gateways, got %d", len(ids), len(out))
  	}
  
  	for i := range gws {
  		out[gws[i].GatewayID] = gws[i]
  	}
  
  	return out, nil
  }
docs: // GetGatewaysForIDs returns a map of gateways given a slice of IDs.