From d596c2ffabb7820f7c17b7540b657d9674866a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Avic=20Simmons?= Date: Mon, 15 Jun 2026 19:17:53 -0400 Subject: [PATCH] docs: fix typos in error messages and Go doc comments --- auto_cache.go | 2 +- auto_cache_fake.go | 2 +- byte_cache_blackhole.go | 10 +++++----- byte_cache_wrapper.go | 10 +++++----- metric/metric.go | 2 +- struct_cache_dummy.go | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/auto_cache.go b/auto_cache.go index ec7f371..7a8ee25 100644 --- a/auto_cache.go +++ b/auto_cache.go @@ -44,7 +44,7 @@ func (storage *StorageAutoCache) getEntry(key string) (*EntryAutoCache, error) { entry, ok := storage.entries[key] storage.lock.RUnlock() if !ok { - err = errors.Errorf("Auto cache key %s nof found", key) + err = errors.Errorf("Auto cache key %s not found", key) } return entry, err diff --git a/auto_cache_fake.go b/auto_cache_fake.go index 1794819..14f2e50 100644 --- a/auto_cache_fake.go +++ b/auto_cache_fake.go @@ -27,7 +27,7 @@ func (storage *StorageAutoCacheFake) Get(key string) (interface{}, error) { updater, find := storage.updaters[key] storage.mutex.RUnlock() if !find { - return nil, errors.Errorf("Auto cache key %s nof found", key) + return nil, errors.Errorf("Auto cache key %s not found", key) } return updater() diff --git a/byte_cache_blackhole.go b/byte_cache_blackhole.go index 77178a8..bdc2534 100644 --- a/byte_cache_blackhole.go +++ b/byte_cache_blackhole.go @@ -13,25 +13,25 @@ func NewBlackholeCache() *BlackholeCache { return &BlackholeCache{} } -// Get returns nil, do nothing +// Get returns nil, does nothing func (cache *BlackholeCache) Get(key *Key) (data []byte, ok bool) { return } -// Put returns nil, do nothing +// Put returns nil, does nothing func (cache *BlackholeCache) Put(data []byte, key *Key, ttl time.Duration) {} -// ScanKeys returns nil, do nothing +// ScanKeys returns nil, does nothing func (cache *BlackholeCache) ScanKeys(set string) ([]Key, error) { return nil, nil } -// Remove returns nil, do nothing +// Remove returns nil, does nothing func (cache *BlackholeCache) Remove(key *Key) (err error) { return } -// Close do nothing +// Close does nothing func (cache *BlackholeCache) Close() {} // Flush removes all entries from cache and returns number of flushed entries diff --git a/byte_cache_wrapper.go b/byte_cache_wrapper.go index 36b67cf..8f60b9d 100644 --- a/byte_cache_wrapper.go +++ b/byte_cache_wrapper.go @@ -54,27 +54,27 @@ func (this *wrapperCache) createRealCache(fn fnCreate) { } } -// Get returns nil, do nothing +// Get returns nil, does nothing func (this *wrapperCache) Get(key *Key) ([]byte, bool) { return this.getCache().Get(key) } -// Put returns nil, do nothing +// Put returns nil, does nothing func (this *wrapperCache) Put(data []byte, key *Key, ttl time.Duration) { this.getCache().Put(data, key, ttl) } -// ScanKeys returns nil, do nothing +// ScanKeys returns nil, does nothing func (this *wrapperCache) ScanKeys(set string) ([]Key, error) { return this.getCache().ScanKeys(set) } -// Remove returns nil, do nothing +// Remove returns nil, does nothing func (this *wrapperCache) Remove(key *Key) error { return this.getCache().Remove(key) } -// Close do nothing +// Close does nothing func (this *wrapperCache) Close() { this.doneChan <- true this.getCache().Close() diff --git a/metric/metric.go b/metric/metric.go index c1b22f3..5f039d2 100644 --- a/metric/metric.go +++ b/metric/metric.go @@ -24,7 +24,7 @@ func SinceMs(started time.Time) float64 { return float64(time.Since(started)) / float64(time.Millisecond) } -// IsError is a trivial helper for minimize repetitive checks for error +// IsError is a trivial helper for minimizing repetitive checks for error // values. It passing appropriate numbers to metrics. func IsError(err error) string { if err != nil { diff --git a/struct_cache_dummy.go b/struct_cache_dummy.go index 4c97b0d..a8e6fe3 100644 --- a/struct_cache_dummy.go +++ b/struct_cache_dummy.go @@ -6,7 +6,7 @@ import ( "go-cache/errors" ) -// StructCacheDummy implements cache that accept any data but always return null +// StructCacheDummy implements cache that accepts any data but always returns null type StructCacheDummy struct { logger IStructCacheLogger } @@ -26,24 +26,24 @@ func (cache *StructCacheDummy) RegisterCacheSet(setName string, limit int, ticke return nil } -// Close do nothing +// Close does nothing func (cache *StructCacheDummy) Close() { cache.logger.Debug("struct_storage_dummy: close()") } -// GetWithTime returns nil, do nothing +// GetWithTime returns nil, does nothing func (cache *StructCacheDummy) GetWithTime(key *Key) (data interface{}, dt time.Time, ok bool) { cache.logger.Debugf("struct_storage_dummy: getWithTime(), key: %s", key.ID()) return } -// Get returns nil, do nothing +// Get returns nil, does nothing func (cache *StructCacheDummy) Get(key *Key) (data interface{}, ok bool) { cache.logger.Debugf("struct_storage_dummy: get(), key: %s", key.ID()) return } -// Put returns nil, do nothing +// Put returns nil, does nothing func (cache *StructCacheDummy) Put(data interface{}, key *Key, ttl time.Duration) error { cache.logger.Debugf("struct_storage_dummy: put(), key: %s", key.ID()) // For the beginning, let's check if it is pointer. @@ -53,7 +53,7 @@ func (cache *StructCacheDummy) Put(data interface{}, key *Key, ttl time.Duration return nil } -// Remove returns nil, do nothing +// Remove returns nil, does nothing func (cache *StructCacheDummy) Remove(key *Key) { cache.logger.Debugf("struct_storage_dummy: remove(), key: %s", key.ID()) }