diff options
| -rw-r--r-- | .golangci.yaml | 1 | ||||
| -rw-r--r-- | internal/cache/clock/clock_ops.go | 4 | ||||
| -rw-r--r-- | internal/cache/clock/shard_read.go | 4 | ||||
| -rw-r--r-- | object/parse.go | 4 | ||||
| -rw-r--r-- | object/store/dual/quarantine.go | 6 | ||||
| -rw-r--r-- | object/store/loose/quarantine.go | 2 | ||||
| -rw-r--r-- | object/store/packed/internal/ingest/ingest.go | 2 | ||||
| -rw-r--r-- | object/stored/stored.go | 2 |
8 files changed, 4 insertions, 21 deletions
diff --git a/.golangci.yaml b/.golangci.yaml index cb9dec5c..ac944be6 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -31,6 +31,7 @@ linters: - dogsled # definitely not an issue, ignoring returns is normal - gomodguard # deprecated - exhaustruct # currently broken, will turn it on again when v4 gets into golangci-lint + - ireturn # much more noise than info settings: perfsprint: diff --git a/internal/cache/clock/clock_ops.go b/internal/cache/clock/clock_ops.go index a21f44c3..6d4785f4 100644 --- a/internal/cache/clock/clock_ops.go +++ b/internal/cache/clock/clock_ops.go @@ -10,15 +10,11 @@ func (clock *Clock[K, V]) Add(key K, value V) bool { } // Get returns the value for key and marks it recently used. -// -//nolint:ireturn func (clock *Clock[K, V]) Get(key K) (V, bool) { return clock.shardFor(key).get(key) } // Peek returns the value for key without changing its recency. -// -//nolint:ireturn func (clock *Clock[K, V]) Peek(key K) (V, bool) { return clock.shardFor(key).peek(key) } diff --git a/internal/cache/clock/shard_read.go b/internal/cache/clock/shard_read.go index 624e3409..279f9725 100644 --- a/internal/cache/clock/shard_read.go +++ b/internal/cache/clock/shard_read.go @@ -1,8 +1,6 @@ package clock // get returns the value for key and marks it referenced. -// -//nolint:ireturn func (shard *shard[K, V]) get(key K) (V, bool) { e, ok := shard.items.Load(key) if !ok { @@ -19,8 +17,6 @@ func (shard *shard[K, V]) get(key K) (V, bool) { } // peek returns the value for key without affecting eviction. -// -//nolint:ireturn func (shard *shard[K, V]) peek(key K) (V, bool) { e, ok := shard.items.Load(key) if !ok { diff --git a/object/parse.go b/object/parse.go index f9779171..2a6c629f 100644 --- a/object/parse.go +++ b/object/parse.go @@ -20,8 +20,6 @@ var ErrSizeMismatch = errors.New("object: size mismatch") // ParseWithHeader parses a loose object // in "type size\x00body" format. -// -//nolint:ireturn func ParseWithHeader(raw []byte, objectFormat id.ObjectFormat) (Object, error) { ty, size, headerLen, err := header.Parse(raw) if err != nil { @@ -37,8 +35,6 @@ func ParseWithHeader(raw []byte, objectFormat id.ObjectFormat) (Object, error) { } // ParseWithoutHeader parses a typed object body. -// -//nolint:ireturn func ParseWithoutHeader(ty typ.Type, body []byte, objectFormat id.ObjectFormat) (Object, error) { switch ty { case typ.Blob: diff --git a/object/store/dual/quarantine.go b/object/store/dual/quarantine.go index 168ba059..6052c134 100644 --- a/object/store/dual/quarantine.go +++ b/object/store/dual/quarantine.go @@ -13,15 +13,11 @@ import ( ) // BeginObjectQuarantine begins an object-wise quarantine on the object side. -// -//nolint:ireturn func (dual *Dual) BeginObjectQuarantine(opts store.ObjectQuarantineOptions) (store.ObjectQuarantine, error) { return dual.object.BeginObjectQuarantine(opts) //nolint:wrapcheck } // BeginPackQuarantine begins a pack-wise quarantine on the pack side. -// -//nolint:ireturn func (dual *Dual) BeginPackQuarantine(opts store.PackQuarantineOptions) (store.PackQuarantine, error) { return dual.pack.BeginPackQuarantine(opts) //nolint:wrapcheck } @@ -30,8 +26,6 @@ func (dual *Dual) BeginPackQuarantine(opts store.PackQuarantineOptions) (store.P // // If the pack side fails to begin, // the already-begun object side is discarded before returning. -// -//nolint:ireturn func (dual *Dual) BeginCoordinatedQuarantine(opts store.CoordinatedQuarantineOptions) (store.CoordinatedQuarantine, error) { objectQ, err := dual.object.BeginObjectQuarantine(opts.Object) if err != nil { diff --git a/object/store/loose/quarantine.go b/object/store/loose/quarantine.go index 214f7219..cd337670 100644 --- a/object/store/loose/quarantine.go +++ b/object/store/loose/quarantine.go @@ -30,7 +30,7 @@ type objectQuarantine struct { // beneath the destination loose root. // // Labels: Deps-Borrowed, Life-Parent, Close-No. -func (loose *Loose) BeginObjectQuarantine(_ store.ObjectQuarantineOptions) (store.ObjectQuarantine, error) { //nolint:ireturn +func (loose *Loose) BeginObjectQuarantine(_ store.ObjectQuarantineOptions) (store.ObjectQuarantine, error) { tempName, tempRoot, err := createLooseQuarantineRoot(loose.root) if err != nil { return nil, err diff --git a/object/store/packed/internal/ingest/ingest.go b/object/store/packed/internal/ingest/ingest.go index 1c47399a..9b60af85 100644 --- a/object/store/packed/internal/ingest/ingest.go +++ b/object/store/packed/internal/ingest/ingest.go @@ -23,7 +23,7 @@ var errTempNamesExhausted = errors.New("object/store/packed/internal/ingest: exh // ingestion holds the state for one WritePack call. type ingestion struct { - ctx context.Context + ctx context.Context //nolint:containedctx // root is the destination objects/pack directory. root *os.Root diff --git a/object/stored/stored.go b/object/stored/stored.go index 68a7bfd0..99c497ee 100644 --- a/object/stored/stored.go +++ b/object/stored/stored.go @@ -18,7 +18,7 @@ func New[T object.Object](id id.ObjectID, obj T) *Stored[T] { } // Object returns the wrapped object as itself. -func (stored *Stored[T]) Object() T { //nolint:ireturn +func (stored *Stored[T]) Object() T { return stored.obj } |
