Skip to content

dont use DecodeMulti #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmcmenamy
Copy link

Hello! I noticed that when logToTerminal is true, EOF errors are printed due to line 578. For example, with go test -v, output includes

=== RUN   TestSendAndUnpackInt
[GoVector]:govec.go:328: TestLogFile-Log.txt exists! ... Deleting 
[GoVector]:govec.go:578: EOF

Printing each field of e when this occurs, the output shows that e.Pid is not set. This is due to dec.DecodeMulti being called after the VClockPayload has already been decoded. This leaves no data for the subsequent decode into d.Pid, hence the EOF.

If desired, I can also add/modify a test like this in govec_test.go:

logToTerminal = true
var buf bytes.Buffer
logger := log.New(&buf, "", 0)
gv.logger = logger
gv.UnpackReceive("TestMessage", packed, &response, opts)
AssertEquals(t, false, strings.Contains(buf.String(), "EOF"), "Error when decoding")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant