Skip to content

Commit

Permalink
fix small rawmessage marshaling issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbaird committed Mar 5, 2014
1 parent d2bd63c commit 2fd1d30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ func main() {
}
// try marshalling to tweet type
var t Tweet
json.Unmarshal(searchresponse.Hits.Hits[0].Source, t)
bytes, err := searchresponse.Hits.Hits[0].Source.MarshalJSON()
if err != nil {
log.Fatalf("err calling marshalJson:%v", err)
}
json.Unmarshal(bytes, t)
log.Printf("Search Found: %s", t)
response, _ = core.Get("twitter", "tweet", "1", nil)
log.Printf("Get: %v", response.Exists)
Expand Down

0 comments on commit 2fd1d30

Please sign in to comment.