Repository navigation
Keep the first decode error in sandboxwire.Decoder - #454
Merged
Merged
Conversation
sandboxwire.Decoder now keeps its first error: every later read returns the zero value, Fail records a protocol's own rule unless an error is already recorded, and Err and Finish return that first error. The File, Process, Link and Network decoders lose their private adapters that added the same rule, and the process shim's IPC decoders read in the same style. Protocol enum checks, bounded counts, Link's Hello version handling and the shim's error texts stay where they were; malformed input fails with the same errors and every golden fixture is unchanged. The six copies of the hex fixture reader become sandboxwiretest.ReadHex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
B4 simplicity audit, lane L1, PR b. There is no wire change, and every golden fixture is byte-identical. Net −215 production lines and −92 test lines.
sandboxwire.Decodernow keeps the first error: later reads return zero values, andErr/Finishreturn that first error. The primitives return values only.readeradapters insandboxfs,sandboxprocess,sandboxlinkandsandboxnet, which each re-implemented this, andDecoder.Remaining, whose only user was a test.processshim/ipc.godecodes the same way. Its error texts and validation order are unchanged.internal/sandboxwire/sandboxwiretest(ReadHex) replaces six copies of the annotated-hex reader.Testing:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.