Skip to content

Commit

Permalink
lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jan 31, 2024
1 parent 381c914 commit 466b2a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dagsync/ipnisync/publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestPublisherWithLibp2pHTTP(t *testing.T) {

req.Equal(link.(cidlink.Link).Cid, headCid)

clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
err = clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
require.NoError(t, err)

// Assert that data is loadable from the link system.
Expand Down Expand Up @@ -230,7 +230,7 @@ func TestExistingServerWithPublisher(t *testing.T) {
req.NoError(err)
req.Equal(link.(cidlink.Link).Cid, headCid)

clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
err = clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
require.NoError(t, err)

// Assert that data is loadable from the link system.
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestHandlerPath(t *testing.T) {
req.NoError(err)
req.Equal(link.(cidlink.Link).Cid, headCid)

clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
err = clientSyncer.Sync(ctx, headCid, selectorparse.CommonSelector_MatchPoint)
require.NoError(t, err)

// Assert that data is loadable from the link system.
Expand Down
6 changes: 3 additions & 3 deletions dagsync/ipnisync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ retry:
case http.StatusOK:
return cb(resp.Body)
case http.StatusNotFound:
io.Copy(io.Discard, resp.Body)
_, _ = io.Copy(io.Discard, resp.Body)
if s.plainHTTP && !s.noPath {
// Try again with no path for legacy http.
log.Warnw("Plain HTTP got not found response, retrying without IPNI path for legacy HTTP")
Expand All @@ -331,7 +331,7 @@ retry:
// being checked already.
return fmt.Errorf("content not found: %w", ipld.ErrNotExists{})
case http.StatusForbidden:
io.Copy(io.Discard, resp.Body)
_, _ = io.Copy(io.Discard, resp.Body)
if s.plainHTTP && !s.noPath {
// Try again with no path for legacy http.
log.Warnw("Plain HTTP got forbidden response, retrying without IPNI path for legacy HTTP")
Expand All @@ -341,7 +341,7 @@ retry:
}
fallthrough
default:
io.Copy(io.Discard, resp.Body)
_, _ = io.Copy(io.Discard, resp.Body)
return fmt.Errorf("non success http fetch response at %s: %d", fetchURL.String(), resp.StatusCode)
}
}
Expand Down
1 change: 0 additions & 1 deletion dagsync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ func TestLatestSyncFailure(t *testing.T) {
cncl()
sub.Close()

dstStore = dssync.MutexWrap(datastore.NewMapDatastore())
sub2, err := dagsync.NewSubscriber(dstHost, dstLnkS,
dagsync.RecvAnnounce(testTopic), dagsync.StrictAdsSelector(false))
require.NoError(t, err)
Expand Down

0 comments on commit 466b2a1

Please sign in to comment.