Sorry for confusing title, but the problem is follows. I have a struct that looks like this:
type Message struct {
UID MessageID `json:"uid"`
Timestamp string `json:"timestamp"`
Info *ClientInfo `json:"info,omitempty"`
Channel Channel `json:"channel"`
Data *json.RawMessage `json:"data"`
Client ConnID `json:"client,omitempty"`
}
After generating *_easyjson.go file I tried to build my source code but got errors:
./message_easyjson.go:23: cannot use in.String() (type string) as type MessageID in assignment
./message_easyjson.go:35: cannot use in.String() (type string) as type Channel in assignment
./message_easyjson.go:47: cannot use in.String() (type string) as type ConnID in assignment
./message_easyjson.go:62: cannot use in.UID (type MessageID) as type string in argument to out.String
./message_easyjson.go:80: cannot use in.Channel (type Channel) as type string in argument to out.String
./message_easyjson.go:93: cannot use in.Client (type ConnID) as type string in argument to out.String
./message_easyjson.go:125: cannot use in.String() (type string) as type UserID in assignment
./message_easyjson.go:127: cannot use in.String() (type string) as type ConnID in assignment
./message_easyjson.go:162: cannot use in.User (type UserID) as type string in argument to out.String
./message_easyjson.go:166: cannot use in.Client (type ConnID) as type string in argument to out.String
Sorry for confusing title, but the problem is follows. I have a struct that looks like this:
After generating
*_easyjson.go
file I tried to build my source code but got errors:Generated code - https://gist.github.com/FZambia/080a25f58ce81c510533
In my case types defined in this way:
And
ClientInfo
isHow this can be fixed?