Skip to content

Commit

Permalink
Merge pull request #87 from pankona/fix-typos
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
tonyghita committed Sep 7, 2022
2 parents 4611304 + ca9a7cb commit 6941216
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion TRACE.md
@@ -1,6 +1,6 @@
# Adding a new trace backend.

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

As an example, this is how you could implement it to an OpenCensus backend.
Expand Down
8 changes: 4 additions & 4 deletions dataloader.go
@@ -1,4 +1,4 @@
// Package dataloader is an implimentation of facebook's dataloader in go.
// Package dataloader is an implementation of facebook's dataloader in go.
// See https://github.com/facebook/dataloader for more information
package dataloader

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

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

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

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

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

// Clear clears the value at `key` from the cache, it it exsits. Returs self for method chaining
// Clear clears the value at `key` from the cache, it it exists. Returns self for method chaining
func (l *Loader[K, V]) Clear(ctx context.Context, key K) Interface[K, V] {
l.cacheLock.Lock()
l.cache.Delete(ctx, key)
Expand Down
4 changes: 2 additions & 2 deletions example/lru_cache/golang_lru_test.go
Expand Up @@ -38,7 +38,7 @@ func (c *cache[K, V]) Delete(_ context.Context, key K) bool {
return false
}

// Clear cleasrs the cache
// Clear clears the cache
func (c *cache[K, V]) Clear() {
c.ARCCache.Purge()
}
Expand All @@ -64,7 +64,7 @@ func ExampleGolangLRU() {
return results
}

// go-cache will automaticlly cleanup expired items on given duration.
// go-cache will automatically cleanup expired items on given duration.
c, _ := lru.NewARC(100)
cache := &cache[int, *User]{ARCCache: c}
loader := dataloader.NewBatchedLoader(batchFunc, dataloader.WithCache[int, *User](cache))
Expand Down
2 changes: 1 addition & 1 deletion example/no_cache/no_cache_test.go
Expand Up @@ -28,7 +28,7 @@ func ExampleNoCache() {
return results
}

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

Expand Down
4 changes: 2 additions & 2 deletions example/ttl_cache/go_cache_test.go
@@ -1,4 +1,4 @@
// package ttl_cache_test contains an exmaple of using go-cache as a long term cache solution for dataloader.
// package ttl_cache_test contains an example of using go-cache as a long term cache solution for dataloader.
package ttl_cache_test

import (
Expand Down Expand Up @@ -68,7 +68,7 @@ func ExampleTTLCache() {
return results
}

// go-cache will automaticlly cleanup expired items on given diration
// go-cache will automatically cleanup expired items on given duration
c := cache.New(15*time.Minute, 15*time.Minute)
cache := &Cache[int, *User]{c}
loader := dataloader.NewBatchedLoader(batchFunc, dataloader.WithCache[int, *User](cache))
Expand Down
2 changes: 1 addition & 1 deletion in_memory_cache.go
Expand Up @@ -30,7 +30,7 @@ func (c *InMemoryCache[K, V]) Set(_ context.Context, key K, value Thunk[V]) {
c.mu.Unlock()
}

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

0 comments on commit 6941216

Please sign in to comment.