MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / parseMessage

Function parseMessage

twitterdata/postprocess/postprocess.go:219–230  ·  view source on GitHub ↗
(message string)

Source from the content-addressed store, hash-verified

217}
218
219func parseMessage(message string) (*anaconda.Tweet, error) {
220 var tweet anaconda.Tweet
221 if err := json.Unmarshal([]byte(message), &tweet); err != nil {
222 return nil, err
223 }
224
225 if tweet.IdStr == "" {
226 return nil, errNotATweet
227 }
228
229 return &tweet, nil
230}
231
232func tweetToJSON(writer io.Writer, tweet *anaconda.Tweet) error {
233 createdAt, err := time.Parse(cTimeFormat, tweet.CreatedAt)

Callers 1

processMessageFunction · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected