Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/gob: Encoder.Encode fails to encode maps with keys of type url.URL #32251
What version of Go are you using (
Perhaps this is just the error being confusing. One cannot take the address of map keys or values directly, so that's probably the error that the encoder is hitting. Perhaps it could copy the key value to then take the copy's address, but I wonder if that could be unexpected behavior. For example, what if the key type is large and copying is a non-trivial amount of work?
Funnily enough, the spec makes no mention of map key/values not being addressable. It seems to be a limitation of the current Go implementation.