oniksan/godobuf

feature: Add setter for message fields

Opened this issue · 1 comments

I'm curious if we could add setters for fields such as arrays and messages, is there any reason you couldn't? Its quite a pain if you already have an object created to then have to create another and set all the fields.

rcorre commented

For arrays, you can do this:

msg.get_list().assign(my_list)

I agree a way to assign a message would be useful though.
I'm not sure if set_message(msg) should copy msg, or assign a reference.

Maybe implementing CopyFrom on message types would make it more clear.