I'm trying to create a method extension to check if my struct was initialized but I'm getting this error:
invalid operation: myStruct literal == inStruct (struct containing json.RawMessage cannot be compared)
Here's my code:
package datamodels
import "encoding/json"
type myStruct struct {
a string json:"a"
b json.RawMessage json:"b"
c json.RawMessage json:"c"
}
func (m *myStruct ) IsEmpty() bool {
return (myStruct {}) == m
}