Skip to content

Commit 85fbc3a

Browse files
authored
fix spelling in comments (#778)
1 parent b66edee commit 85fbc3a

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

namesys/interface.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func PublishWithEOL(eol time.Time) PublishOption {
207207
}
208208
}
209209

210-
// PublishWithEOL sets [PublishOptions.TTL].
210+
// PublishWithTTL sets [PublishOptions.TTL].
211211
func PublishWithTTL(ttl time.Duration) PublishOption {
212212
return func(o *PublishOptions) {
213213
o.TTL = ttl

pinning/pinner/dspinner/pin_test.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func TestAddLoadPin(t *testing.T) {
367367
t.Fatal(err)
368368
}
369369
if pinData.Mode != mode {
370-
t.Error("worng pin mode")
370+
t.Error("wrong pin mode")
371371
}
372372
if pinData.Cid != ak {
373373
t.Error("wrong pin cid")
@@ -428,17 +428,17 @@ func TestPinAddOverwriteName(t *testing.T) {
428428
}
429429

430430
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:
433433
//
434434
// A5->A4->A3->A2->A1->A0
435435
// / /
436436
// B------- /
437437
// \ /
438438
// C---------------
439439
//
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.
442442
aBranchLen := 6
443443

444444
ctx, cancel := context.WithCancel(context.Background())
@@ -449,8 +449,8 @@ func TestIsPinnedLookup(t *testing.T) {
449449

450450
dserv := mdag.NewDAGService(bserv)
451451

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.
454454
p, err := New(ctx, dstore, dserv)
455455
if err != nil {
456456
t.Fatal(err)
@@ -563,7 +563,7 @@ func TestPinRecursiveFail(t *testing.T) {
563563
t.Fatal(err)
564564
}
565565

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
567567
mctx, cancel := context.WithTimeout(ctx, time.Millisecond)
568568
defer cancel()
569569

@@ -582,7 +582,7 @@ func TestPinRecursiveFail(t *testing.T) {
582582
t.Fatal(err)
583583
}
584584

585-
// this one is time based... but shouldnt cause any issues
585+
// this one is time based... but shouldn't cause any issues
586586
mctx, cancel = context.WithTimeout(ctx, time.Second)
587587
defer cancel()
588588
err = p.Pin(mctx, a, true, "")
@@ -732,7 +732,7 @@ func TestLoadDirty(t *testing.T) {
732732
t.Fatal("index should be deleted")
733733
}
734734

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
736736
// detect the dirty flag and repair the indexes.
737737
p, err = New(ctx, dstore, dserv)
738738
if err != nil {
@@ -950,7 +950,7 @@ func makeStore() (ds.Datastore, ipld.DAGService) {
950950
return dstore, dserv
951951
}
952952

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
954954
// compares the load time when rebuilding indexes to loading without rebuilding
955955
// indexes.
956956
func BenchmarkLoad(b *testing.B) {
@@ -995,8 +995,8 @@ func BenchmarkLoad(b *testing.B) {
995995
})
996996
}
997997

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
10001000
// creating a pin in a larger number of existing pins.
10011001
func BenchmarkNthPin(b *testing.B) {
10021002
dstore, dserv := makeStore()
@@ -1044,8 +1044,8 @@ func benchmarkNthPin(b *testing.B, count int, pinner ipfspin.Pinner, dserv ipld.
10441044
}
10451045
}
10461046

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.
10491049
func BenchmarkNPins(b *testing.B) {
10501050
for count := 128; count < 16386; count <<= 1 {
10511051
b.Run(fmt.Sprint("PinDS-", count), func(b *testing.B) {
@@ -1270,7 +1270,7 @@ func TestCidIndex(t *testing.T) {
12701270
defer results.Close()
12711271

12721272
// 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.
12741274
seen = false
12751275
for r := range results.Next() {
12761276
if seen {

routing/http/filters/filters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func AddFiltersToURL(baseURL string, protocolFilter, addrFilter []string) string
4949
return parsedURL.String()
5050
}
5151

52-
// applyFiltersToIter applies the filters to the given iterator and returns a new iterator.
52+
// ApplyFiltersToIter applies the filters to the given iterator and returns a new iterator.
5353
//
5454
// The function iterates over the input iterator, applying the specified filters to each record.
5555
// It supports both positive and negative filters for both addresses and protocols.

routing/http/internal/goroutines.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import (
77
"github.com/samber/lo"
88
)
99

10-
// DoBatch processes a slice of items with concurrency no higher than maxConcurrency by splitting it into batches no larger than maxBatchSize.
11-
// If an error is returned for any batch, the process is short-circuited and the error is immediately returned.
10+
// DoBatch processes a slice of items with concurrency no higher than
11+
// maxConcurrency by splitting it into batches no larger than maxBatchSize. If
12+
// an error is returned for any batch, the process is short-circuited and the
13+
// error is immediately returned.
1214
func DoBatch[A any](ctx context.Context, maxBatchSize, maxConcurrency int, items []A, f func(context.Context, []A) error) error {
1315
if len(items) == 0 {
1416
return nil
@@ -62,8 +64,8 @@ func DoBatch[A any](ctx context.Context, maxBatchSize, maxConcurrency int, items
6264
// we finished without any errors, congratulations
6365
return nil
6466
}
65-
// short circuit on the first error we get
66-
// canceling the worker ctx and thus all workers,
67+
// short circuit on the first error we get canceling the worker ctx and
68+
// thus all workers,
6769
return err
6870
case <-ctx.Done():
6971
return ctx.Err()

0 commit comments

Comments
 (0)