You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
Since peer.IDs defines themselves as str, defining a map[peer.ID]<type> and marshaling that to JSON does not make use of the MarshalText() facility to encode the map keys. Somehow default encoding/decoding when doing it doesn't work (it decodes peers with different IDs but doesn't complain, which is worse).
Probably doing the same thing as cids and switching to type ID struct { str string } would fix this.
However, this might be very breaking because people rely on doing pid1 == pid2 (and I think that would stop working, at least from outside this package? it is not clear from the Go documentation).
Thoughts?
The text was updated successfully, but these errors were encountered:
Since
peer.ID
s defines themselves asstr
, defining amap[peer.ID]<type>
and marshaling that to JSON does not make use of theMarshalText()
facility to encode the map keys. Somehow default encoding/decoding when doing it doesn't work (it decodes peers with different IDs but doesn't complain, which is worse).See golang/go#28827
Probably doing the same thing as
cid
s and switching totype ID struct { str string }
would fix this.However, this might be very breaking because people rely on doing
pid1 == pid2
(and I think that would stop working, at least from outside this package? it is not clear from the Go documentation).Thoughts?
The text was updated successfully, but these errors were encountered: