Skip to content

Commit

Permalink
Call defer properly
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Apr 12, 2024
1 parent 5f986d7 commit 8afc7e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions receiver/namedpipereceiver/namedpipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func TestReadPipe(t *testing.T) {
rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, sink)
require.NoError(t, err, "failed to create receiver")
require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
defer require.NoError(t, rcvr.Shutdown(context.Background()))
defer converter.Stop()
defer func() { require.NoError(t, rcvr.Shutdown(context.Background())) }()
defer func() { converter.Stop() }()

pipe, err := os.OpenFile("/tmp/pipe", os.O_WRONLY, 0o600)
require.NoError(t, err, "failed to open pipe")
Expand Down

0 comments on commit 8afc7e7

Please sign in to comment.