Skip to content

Commit 6941216

Browse files
authored
Merge pull request #87 from pankona/fix-typos
fix typos
2 parents 4611304 + ca9a7cb commit 6941216

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

TRACE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Adding a new trace backend.
22

3-
If you whant to add a new tracing backend all you need to do is implement the
3+
If you want to add a new tracing backend all you need to do is implement the
44
`Tracer` interface and pass it as an option to the dataloader on initialization.
55

66
As an example, this is how you could implement it to an OpenCensus backend.

dataloader.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package dataloader is an implimentation of facebook's dataloader in go.
1+
// Package dataloader is an implementation of facebook's dataloader in go.
22
// See https://github.com/facebook/dataloader for more information
33
package dataloader
44

@@ -242,7 +242,7 @@ func (l *Loader[K, V]) Load(originalContext context.Context, key K) Thunk[V] {
242242
l.cache.Set(ctx, key, thunk)
243243
l.cacheLock.Unlock()
244244

245-
// this is sent to batch fn. It contains the key and the channel to return the
245+
// this is sent to batch fn. It contains the key and the channel to return
246246
// the result on
247247
req := &batchRequest[K, V]{key, c}
248248

@@ -279,7 +279,7 @@ func (l *Loader[K, V]) Load(originalContext context.Context, key K) Thunk[V] {
279279
return thunk
280280
}
281281

282-
// LoadMany loads mulitiple keys, returning a thunk (type: ThunkMany) that will resolve the keys passed in.
282+
// LoadMany loads multiple keys, returning a thunk (type: ThunkMany) that will resolve the keys passed in.
283283
func (l *Loader[K, V]) LoadMany(originalContext context.Context, keys []K) ThunkMany[V] {
284284
ctx, finish := l.tracer.TraceLoadMany(originalContext, keys)
285285

@@ -347,7 +347,7 @@ func (l *Loader[K, V]) LoadMany(originalContext context.Context, keys []K) Thunk
347347
return thunkMany
348348
}
349349

350-
// Clear clears the value at `key` from the cache, it it exsits. Returs self for method chaining
350+
// Clear clears the value at `key` from the cache, it it exists. Returns self for method chaining
351351
func (l *Loader[K, V]) Clear(ctx context.Context, key K) Interface[K, V] {
352352
l.cacheLock.Lock()
353353
l.cache.Delete(ctx, key)

example/lru_cache/golang_lru_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c *cache[K, V]) Delete(_ context.Context, key K) bool {
3838
return false
3939
}
4040

41-
// Clear cleasrs the cache
41+
// Clear clears the cache
4242
func (c *cache[K, V]) Clear() {
4343
c.ARCCache.Purge()
4444
}
@@ -64,7 +64,7 @@ func ExampleGolangLRU() {
6464
return results
6565
}
6666

67-
// go-cache will automaticlly cleanup expired items on given duration.
67+
// go-cache will automatically cleanup expired items on given duration.
6868
c, _ := lru.NewARC(100)
6969
cache := &cache[int, *User]{ARCCache: c}
7070
loader := dataloader.NewBatchedLoader(batchFunc, dataloader.WithCache[int, *User](cache))

example/no_cache/no_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func ExampleNoCache() {
2828
return results
2929
}
3030

31-
// go-cache will automaticlly cleanup expired items on given diration
31+
// go-cache will automatically cleanup expired items on given duration
3232
cache := &dataloader.NoCache[int, *User]{}
3333
loader := dataloader.NewBatchedLoader(batchFunc, dataloader.WithCache[int, *User](cache))
3434

example/ttl_cache/go_cache_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// package ttl_cache_test contains an exmaple of using go-cache as a long term cache solution for dataloader.
1+
// package ttl_cache_test contains an example of using go-cache as a long term cache solution for dataloader.
22
package ttl_cache_test
33

44
import (
@@ -68,7 +68,7 @@ func ExampleTTLCache() {
6868
return results
6969
}
7070

71-
// go-cache will automaticlly cleanup expired items on given diration
71+
// go-cache will automatically cleanup expired items on given duration
7272
c := cache.New(15*time.Minute, 15*time.Minute)
7373
cache := &Cache[int, *User]{c}
7474
loader := dataloader.NewBatchedLoader(batchFunc, dataloader.WithCache[int, *User](cache))

in_memory_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (c *InMemoryCache[K, V]) Set(_ context.Context, key K, value Thunk[V]) {
3030
c.mu.Unlock()
3131
}
3232

33-
// Get gets the value at `key` if it exsits, returns value (or nil) and bool
33+
// Get gets the value at `key` if it exists, returns value (or nil) and bool
3434
// indicating of value was found
3535
func (c *InMemoryCache[K, V]) Get(_ context.Context, key K) (Thunk[V], bool) {
3636
c.mu.RLock()

0 commit comments

Comments
 (0)