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
In actual, nothing is optional. Both App and Data must be non-nil values. What happens internally is:
If the app is noApp: for encoding, we encode false and just return. for decoding, we read the false value and set app, data to noApp and noData repectively.
Else: for encoding, we encode true, followed by the app and data. for decoding: we read the true value and then decode the app and data.
With the above understanding, I think a single struct called AppAndData with Encode and Decode methods defined on it will be a better approach.
However, this was an existing construct, which I only moved it from one package to another.
Because, this PR in itself is somewhat large, if we need to modify this, I think we should do in a separate one.
In actual, nothing is optional. Both App and Data must be non-nil values. What happens internally is:
noApp
: for encoding, we encode false and just return. for decoding, we read the false value and set app, data to noApp and noData repectively.With the above understanding, I think a single struct called
AppAndData
withEncode
andDecode
methods defined on it will be a better approach.However, this was an existing construct, which I only moved it from one package to another.
Because, this PR in itself is somewhat large, if we need to modify this, I think we should do in a separate one.
Originally posted by @manoranjith in #272 (comment)
The text was updated successfully, but these errors were encountered: