Gob helps with (de)serializing data structures. mapset.Set is an
interface. It doesn't help that the underlying data structure that the
interface points to is unexported, hence it can only be registered with
gob by the package itself. If the package doesn't do that, the package
user can't do that.
Alternatives from the top of my head:
1. Write your own Un/MarshalBinary() functions.
2. Implement your own set using map[string]struct{}, guarded by a mutex
if it's to be accessed concurrently.
I lean towards (2). It saves you the time spent trying to learn the
quirks of a third party package. Make the mutex an unexported, named
field so it's ignored by gob (a mutex is something that holds no meaning
when serialized).
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.