Skip to content

How to create a QuotedMessage using JSON ? #215

Discussion options

You must be logged in to vote

Your json path should be match with proto.Message structure (key).

In my code i have to Unmarshaling json to proto.Message and if no errors on the progress, the message could be used as a quotes message.

var msg_quote proto.Message
var json_quote = []byte("{...}")

if err := json.Unmarshal(json_quote, &msg_quote); err != nil {
    panic(err)
} else {
    // send msg_quote message
}

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@frmdeveloper
Comment options

@mamur-rezeki
Comment options

@frmdeveloper
Comment options

@mamur-rezeki
Comment options

@frmdeveloper
Comment options

Answer selected by frmdeveloper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants