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
I tried to decode a MapType which had interface keys and values.
I was able to decode it with these additions.
type.py:
classGoInterface(GoType):
typeid=INTERFACEzero=None# Seems to work.def__init__(self, loader):
self._loader=loaderdefdecode(self, buf):
typename, buf=GoString.decode(buf)
# A nil value has an empty typename. What does that mean?typeid, buf=GoInt.decode(buf)
segment, buf=self._loader._read_segment(buf)
zero, segment=GoUint.decode(segment) #What's this about?assertzero==0, 'illegal delta for singleton: %s'%zerovalue, segment=self._loader.decode_value(typeid, segment)
assertsegment==b'', 'trailing data in segment: %s'%list(segment)
returnvalue, buf
However, I don't know if this code only works for my own case (being new to Go), and I don't know if I made the right choices, such as inheriting from GoType. I am also uncomfortable with discarding the typename information.
The text was updated successfully, but these errors were encountered:
I tried to decode a MapType which had
interface
keys and values.I was able to decode it with these additions.
type.py
:loader.py
:However, I don't know if this code only works for my own case (being new to Go), and I don't know if I made the right choices, such as inheriting from GoType. I am also uncomfortable with discarding the typename information.
The text was updated successfully, but these errors were encountered: