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
The Set command takes any type as value (using the interface{}), but throws a runtime error when the value does not implement encoding.BinaryMarshaler. Having the type of value as encoding.BinaryMarshaler instead of interface{} can prevent such runtime errors by making them a compile time error. Are there any downsides for this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The
Set
command takes any type as value (using theinterface{}
), but throws a runtime error when the value does not implementencoding.BinaryMarshaler
. Having the type of value asencoding.BinaryMarshaler
instead ofinterface{}
can prevent such runtime errors by making them a compile time error. Are there any downsides for this?Beta Was this translation helpful? Give feedback.
All reactions