Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint warnings
Browse files Browse the repository at this point in the history
gammazero committed Jan 8, 2024
1 parent 9f1e40b commit 6eccae6
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
@@ -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.
@@ -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.
@@ -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.
6 changes: 3 additions & 3 deletions dagsync/ipnisync/sync.go
Original file line number Diff line number Diff line change
@@ -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")
@@ -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")
@@ -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)
}
}
1 change: 0 additions & 1 deletion dagsync/sync_test.go
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 6eccae6

Please sign in to comment.