Is it possible to create a json.RawMessage literal in Golang?
I want to be able to do something like this:
type ErrorMessage struct {
Timestamp string
Message json.RawMessage
}
func getTestData() ErrorMessage {
return ErrorMessage{
Timestamp: "test-time",
Message: "{}"
}
}
Or something like that. This is the most succinct I've seen. I have not been able to find an example of a "struct" literal for creating raw json messages.