Answer the question
In order to leave comments, you need to log in
Analog json.RawMessage for structures?
It is necessary for me that in structure I could put any other structure. Something like
type Packet struct {
Type string
Body json.RawMessage
}
type Page struct {
Title string
Body *struct{}
}
Answer the question
In order to leave comments, you need to log in
There is an empty interface
specifically for this.
type Page struct {
Title string
Body interface{}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question