@@ -367,7 +367,7 @@ func TestAddLoadPin(t *testing.T) {
367
367
t .Fatal (err )
368
368
}
369
369
if pinData .Mode != mode {
370
- t .Error ("worng pin mode" )
370
+ t .Error ("wrong pin mode" )
371
371
}
372
372
if pinData .Cid != ak {
373
373
t .Error ("wrong pin cid" )
@@ -428,17 +428,17 @@ func TestPinAddOverwriteName(t *testing.T) {
428
428
}
429
429
430
430
func TestIsPinnedLookup (t * testing.T ) {
431
- // Test that lookups work in pins which share
432
- // the same branches. For that construct this tree:
431
+ // Test that lookups work in pins which share the same branches. For that
432
+ // construct this tree:
433
433
//
434
434
// A5->A4->A3->A2->A1->A0
435
435
// / /
436
436
// B------- /
437
437
// \ /
438
438
// C---------------
439
439
//
440
- // This ensures that IsPinned works for all objects both when they
441
- // are pinned and once they have been unpinned.
440
+ // This ensures that IsPinned works for all objects both when they are
441
+ // pinned and once they have been unpinned.
442
442
aBranchLen := 6
443
443
444
444
ctx , cancel := context .WithCancel (context .Background ())
@@ -449,8 +449,8 @@ func TestIsPinnedLookup(t *testing.T) {
449
449
450
450
dserv := mdag .NewDAGService (bserv )
451
451
452
- // Create new pinner. New will not load anything since there are
453
- // no pins saved in the datastore yet.
452
+ // Create new pinner. New will not load anything since there are no pins
453
+ // saved in the datastore yet.
454
454
p , err := New (ctx , dstore , dserv )
455
455
if err != nil {
456
456
t .Fatal (err )
@@ -563,7 +563,7 @@ func TestPinRecursiveFail(t *testing.T) {
563
563
t .Fatal (err )
564
564
}
565
565
566
- // NOTE: This isnt a time based test, we expect the pin to fail
566
+ // NOTE: This isn't a time based test, we expect the pin to fail
567
567
mctx , cancel := context .WithTimeout (ctx , time .Millisecond )
568
568
defer cancel ()
569
569
@@ -582,7 +582,7 @@ func TestPinRecursiveFail(t *testing.T) {
582
582
t .Fatal (err )
583
583
}
584
584
585
- // this one is time based... but shouldnt cause any issues
585
+ // this one is time based... but shouldn't cause any issues
586
586
mctx , cancel = context .WithTimeout (ctx , time .Second )
587
587
defer cancel ()
588
588
err = p .Pin (mctx , a , true , "" )
@@ -732,7 +732,7 @@ func TestLoadDirty(t *testing.T) {
732
732
t .Fatal ("index should be deleted" )
733
733
}
734
734
735
- // Create new pinner on same datastore that was never flushed. This should
735
+ // Create new pinner on same datastore that was never flushed. This should
736
736
// detect the dirty flag and repair the indexes.
737
737
p , err = New (ctx , dstore , dserv )
738
738
if err != nil {
@@ -950,7 +950,7 @@ func makeStore() (ds.Datastore, ipld.DAGService) {
950
950
return dstore , dserv
951
951
}
952
952
953
- // BenchmarkLoadRebuild loads a pinner that has some number of saved pins, and
953
+ // BenchmarkLoad loads a pinner that has some number of saved pins, and
954
954
// compares the load time when rebuilding indexes to loading without rebuilding
955
955
// indexes.
956
956
func BenchmarkLoad (b * testing.B ) {
@@ -995,8 +995,8 @@ func BenchmarkLoad(b *testing.B) {
995
995
})
996
996
}
997
997
998
- // BenchmarkNthPins shows the time it takes to create/save 1 pin when a number
999
- // of other pins already exist. Each run in the series shows performance for
998
+ // BenchmarkNthPin shows the time it takes to create/save 1 pin when a number
999
+ // of other pins already exist. Each run in the series shows performance for
1000
1000
// creating a pin in a larger number of existing pins.
1001
1001
func BenchmarkNthPin (b * testing.B ) {
1002
1002
dstore , dserv := makeStore ()
@@ -1044,8 +1044,8 @@ func benchmarkNthPin(b *testing.B, count int, pinner ipfspin.Pinner, dserv ipld.
1044
1044
}
1045
1045
}
1046
1046
1047
- // BenchmarkNPins demonstrates creating individual pins. Each run in the
1048
- // series shows performance for a larger number of individual pins.
1047
+ // BenchmarkNPins demonstrates creating individual pins. Each run in the series
1048
+ // shows performance for a larger number of individual pins.
1049
1049
func BenchmarkNPins (b * testing.B ) {
1050
1050
for count := 128 ; count < 16386 ; count <<= 1 {
1051
1051
b .Run (fmt .Sprint ("PinDS-" , count ), func (b * testing.B ) {
@@ -1270,7 +1270,7 @@ func TestCidIndex(t *testing.T) {
1270
1270
defer results .Close ()
1271
1271
1272
1272
// Iterate all pins and check if the corresponding recursive or direct
1273
- // index is missing. If the index is missing then create the index.
1273
+ // index is missing. If the index is missing then create the index.
1274
1274
seen = false
1275
1275
for r := range results .Next () {
1276
1276
if seen {
0 commit comments