Skip to content

Instantly share code, notes, and snippets.

@BenHall
Created August 11, 2014 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenHall/8b80480dd9d8374b7c38 to your computer and use it in GitHub Desktop.
Save BenHall/8b80480dd9d8374b7c38 to your computer and use it in GitHub Desktop.
var prediction Prediction
get_resp := elasticsearch.Get(index, key)
if(get_resp == nil) {
prediction = Prediction {EventId: eventId, UserId: userid}
} else {
json.Unmarshal(*get_resp.Source, &prediction)
}
//cannot convert nil to type elasticsearch.ElasticGetResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment