Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/p2p/libp2p/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func TestStreamVersion(t *testing.T) {

if v == nil {
t.Fatal("expected version to be non-nil")
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to return here? this is unreachable code. from go doc testing.T:

    A test ends when its Test function returns or calls any of the methods
    T.FailNow, T.Fatal, T.Fatalf, T.SkipNow, T.Skip, or T.Skipf. Those methods,
    as well as the T.Parallel method, must be called only from the goroutine
    running the Test function.

@akrem-chabchoub akrem-chabchoub Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I merged without seeing your comment.
Linter failed and prevented me from push:
7a40425

image

@akrem-chabchoub akrem-chabchoub Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pull master into this branch and run make lint and it works without any issues, although nothing in master is referring to some lint changes, this is wired, didn't know why!

I reverted the changes here: #5598

}

expected := semver.Version{Major: tc.wantMajor, Minor: tc.wantMinor}
Expand Down
8 changes: 8 additions & 0 deletions pkg/p2p/protobuf/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func newReader(r ggio.Reader) Reader {
}

func (r Reader) ReadMsgWithContext(ctx context.Context, msg proto.Message) error {
if err := ctx.Err(); err != nil {
return err
}

errChan := make(chan error, 1)
go func() {
errChan <- r.ReadMsg(msg)
Expand All @@ -78,6 +82,10 @@ func newWriter(r ggio.Writer) Writer {
}

func (w Writer) WriteMsgWithContext(ctx context.Context, msg proto.Message) error {
if err := ctx.Err(); err != nil {
return err
}

errChan := make(chan error, 1)
go func() {
errChan <- w.WriteMsg(msg)
Expand Down
Loading