Gob is used to serialize and deserialize whole Go objects. Dropping fields while serializing makes no sense for this use case.
I disagree with that. Some objects have fields that are volatile and make no sense to (de)serialize. Gob does not use struct tags, though, and I don't think it should start doing so just to support field hiding. If you don't want a field to be (de)serialized, either don't export it, or implement Gob{En,De}code yourself.
Dan Kortschak
unread,
Apr 4, 2014, 9:15:12 PM4/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Matt Harden, Volker Dobler, golang-nuts
Or copy the struct and zero the relevant fields in the copy before encoding.