Open andig opened 2 days ago
An alternative approach would of course be to use pointer to message consistently throughout. That would make for simpler error return values (nil
instead of Message{}
).
Hm... good point. Still thinking ... to be honest I tend to like pointer everywhere more. Both would be breaking changes, but I assume expect you only the cmd utility is used by others (at least as I know).
I know the difference had caused me quite a bit of confusion. I‘d be happy either way.
Thanks for the issue and PR... have to find time to do it the pointer way, but doesn't hurry for now.
While Send takes a Message it returns a *Message. Send uses SendMultiple which works on Message only. Internally, receive works on Messages only. I suggest to change the Send signature to return a Message and modify NewMessage accordingly.