Repository: kopia/kopia
Pull request #3611 (2024-02-03 07:04:34)

build(deps): upgraded linter to v1.55.2, fixed warnings

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) Report
Attention: `12 lines` in your changes are missing coverage. Please review.
> :exclamation: No coverage uploaded for pull request base (`master@c478141`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#section-missing-base-commit).

| [Files](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) | Patch % | Lines |
|---|---|---|
| [internal/server/api\_repo.go](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvc2VydmVyL2FwaV9yZXBvLmdv) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) |
| [internal/server/grpc\_session.go](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvc2VydmVyL2dycGNfc2Vzc2lvbi5nbw==) | 62.50% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) |
| [internal/server/api\_error.go](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvc2VydmVyL2FwaV9lcnJvci5nbw==) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) |
| [internal/server/api\_policies.go](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvc2VydmVyL2FwaV9wb2xpY2llcy5nbw==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) |
| [repo/grpc\_repository\_client.go](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-cmVwby9ncnBjX3JlcG9zaXRvcnlfY2xpZW50Lmdv) | 95.83% | [1 Missing :warning: ](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##             master    #3611   +/-   ##
=========================================
  Coverage          ?   75.85%           
=========================================
  Files             ?      467           
  Lines             ?    37197           
  Branches          ?        0           
=========================================
  Hits              ?    28216           
  Misses            ?     7052           
  Partials          ?     1929           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/kopia/kopia/pull/3611?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).


Patch:
diff --git a/.golangci.yml b/.golangci.yml
index d61e6330..a9a96b2c 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -118,6 +118,7 @@ issues:
       - funlen
       - gochecknoglobals
       - gocognit
+      - goconst
       - gomnd
       - gosec
       - musttag
@@ -171,3 +172,6 @@ issues:
     - text: "unwrapped: sig: func github.com/kopia/kopia/fs.GetAllEntries"
       linters:
         - wrapcheck
+    - text: "float-compare: use require.InEpsilon"
+      linters:
+        - testifylint
diff --git a/cli/show_utils.go b/cli/show_utils.go
index b700c3b4..f903190f 100644
--- a/cli/show_utils.go
+++ b/cli/show_utils.go
@@ -7,6 +7,7 @@
 	"encoding/json"
 	"fmt"
 	"io"
+	"strconv"
 	"strings"
 	"time"
 
@@ -57,7 +58,7 @@ func maybeHumanReadableBytes(enable bool, value int64) string {
 		return units.BytesString(value)
 	}
 
-	return fmt.Sprintf("%v", value)
+	return strconv.FormatInt(value, 10)
 }
 
 func maybeHumanReadableCount(enable bool, value int64) string {
@@ -65,7 +66,7 @@ func maybeHumanReadableCount(enable bool, value int64) string {
 		return units.Count(value)
 	}
 
-	return fmt.Sprintf("%v", value)
+	return strconv.FormatInt(value, 10)
 }
 
 func formatTimestamp(ts time.Time) string {
diff --git a/internal/gather/gather_write_buffer_chunk.go b/internal/gather/gather_write_buffer_chunk.go
index b7c8fe4e..666c2a8b 100644
--- a/internal/gather/gather_write_buffer_chunk.go
+++ b/internal/gather/gather_write_buffer_chunk.go
@@ -4,7 +4,6 @@
 	"context"
 	"fmt"
 	"os"
-	"reflect"
 	"runtime"
 	"strings"
 	"sync"
@@ -85,13 +84,13 @@ func (a *chunkAllocator) trackAlloc(v []byte) []byte {
 			}
 		}
 
-		hdr := (*reflect.SliceHeader)(unsafe.Pointer(&v)) //nolint:gosec
+		ptr := uintptr(unsafe.Pointer(unsafe.SliceData(v))) //nolint:gosec
 
 		if a.activeChunks == nil {
 			a.activeChunks = map[uintptr]string{}
 		}
 
-		a.activeChunks[hdr.Data] = strings.Join(callerFrames, "\n")
+		a.activeChunks[ptr] = strings.Join(callerFrames, "\n")
 	}
 
 	return v
@@ -128,8 +127,8 @@ func (a *chunkAllocator) releaseChunk(s []byte) {
 	defer a.mu.Unlock()
 
 	if a.activeChunks != nil {
-		hdr := (*reflect.SliceHeader)(unsafe.Pointer(&s)) //nolint:gosec
-		delete(a.activeChunks, hdr.Data)
+		ptr := uintptr(unsafe.Pointer(unsafe.SliceData(s))) //nolint:gosec
+		delete(a.activeChunks, ptr)
 	}
 
 	a.freed++
diff --git a/internal/providervalidation/providervalidation.go b/internal/providervalidation/providervalidation.go
index a311b8f9..481fc932 100644
--- a/internal/providervalidation/providervalidation.go
+++ b/internal/providervalidation/providervalidation.go
@@ -4,6 +4,7 @@
 import (
 	"bytes"
 	"context"
+	"encoding/hex"
 	"fmt"
 	"math/rand"
 	"os"
@@ -320,7 +321,7 @@ func (c *concurrencyTest) putBlobWorker(ctx context.Context, worker int) func()
 			seed := rand.Int63() //nolint:gosec
 			data := c.dataFromSeed(seed, data0)
 
-			id := c.prefix + blob.ID(fmt.Sprintf("%x", data[0:16]))
+			id := c.prefix + blob.ID(hex.EncodeToString(data[0:16]))
 
 			c.mu.Lock()
 			c.blobSeeds[id] = seed
diff --git a/internal/server/api_error.go b/internal/server/api_error.go
index ec72b085..6152624a 100644
--- a/internal/server/api_error.go
+++ b/internal/server/api_error.go
@@ -19,6 +19,10 @@ func requestError(apiErrorCode serverapi.APIErrorCode, message string) *apiError
 	return &apiError{http.StatusBadRequest, apiErrorCode, message}
 }
 
+func unableToDecodeRequest(err error) *apiError {
+	return requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+}
+
 func notFoundError(message string) *apiError {
 	return &apiError{http.StatusNotFound, serverapi.ErrorNotFound, message}
 }
diff --git a/internal/server/api_policies.go b/internal/server/api_policies.go
index b5d115a3..337983f6 100644
--- a/internal/server/api_policies.go
+++ b/internal/server/api_policies.go
@@ -66,7 +66,7 @@ func handlePolicyResolve(ctx context.Context, rc requestContext) (interface{}, *
 	var req serverapi.ResolvePolicyRequest
 
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	target := getSnapshotSourceFromURL(rc.req.URL)
diff --git a/internal/server/api_repo.go b/internal/server/api_repo.go
index 1e88427b..3e499c50 100644
--- a/internal/server/api_repo.go
+++ b/internal/server/api_repo.go
@@ -128,7 +128,7 @@ func handleRepoCreate(ctx context.Context, rc requestContext) (interface{}, *api
 	var req serverapi.CreateRepositoryRequest
 
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	if err := maybeDecodeToken(&req.ConnectRepositoryRequest); err != nil {
@@ -181,7 +181,7 @@ func handleRepoExists(ctx context.Context, rc requestContext) (interface{}, *api
 	var req serverapi.CheckRepositoryExistsRequest
 
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	st, err := blob.NewStorage(ctx, req.Storage, false)
@@ -213,7 +213,7 @@ func handleRepoConnect(ctx context.Context, rc requestContext) (interface{}, *ap
 	var req serverapi.ConnectRepositoryRequest
 
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	if err := maybeDecodeToken(&req); err != nil {
@@ -254,7 +254,7 @@ func handleRepoSetDescription(ctx context.Context, rc requestContext) (interface
 	var req repo.ClientOptions
 
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	cliOpt := rc.rep.ClientOptions()
@@ -345,7 +345,7 @@ func handleRepoSetThrottle(ctx context.Context, rc requestContext) (interface{},
 
 	var req throttling.Limits
 	if err := json.Unmarshal(rc.body, &req); err != nil {
-		return nil, requestError(serverapi.ErrorMalformedRequest, "unable to decode request: "+err.Error())
+		return nil, unableToDecodeRequest(err)
 	}
 
 	if err := dr.Throttler().SetLimits(req); err != nil {
diff --git a/internal/server/grpc_session.go b/internal/server/grpc_session.go
index 3dbe2cc4..fcd3f425 100644
--- a/internal/server/grpc_session.go
+++ b/internal/server/grpc_session.go
@@ -134,7 +134,7 @@ func (s *Server) Session(srv grpcapi.KopiaRepository_SessionServer) error {
 				defer s.grpcServerState.sem.Release(1)
 
 				handleSessionRequest(ctx, dw, authz, usernameAtHostname, req, func(resp *grpcapi.SessionResponse) {
-					if err := s.send(srv, req.RequestId, resp); err != nil {
+					if err := s.send(srv, req.GetRequestId(), resp); err != nil {
 						select {
 						case lastErr <- err:
 						default:
@@ -151,9 +151,9 @@ func (s *Server) Session(srv grpcapi.KopiaRepository_SessionServer) error {
 var tracer = otel.Tracer("kopia/grpc")
 
 func handleSessionRequest(ctx context.Context, dw repo.DirectRepositoryWriter, authz auth.AuthorizationInfo, usernameAtHostname string, req *grpcapi.SessionRequest, respond func(*grpcapi.SessionResponse)) {
-	if req.TraceContext != nil {
+	if req.GetTraceContext() != nil {
 		var tc propagation.TraceContext
-		ctx = tc.Extract(ctx, propagation.MapCarrier(req.TraceContext))
+		ctx = tc.Extract(ctx, propagation.MapCarrier(req.GetTraceContext()))
 	}
 
 	switch inner := req.GetRequest().(type) {
@@ -429,12 +429,12 @@ func handlePrefetchContentsRequest(ctx context.Context, rep repo.Repository, aut
 		return accessDeniedResponse()
 	}
 
-	contentIDs, err := content.IDsFromStrings(req.ContentIds)
+	contentIDs, err := content.IDsFromStrings(req.GetContentIds())
 	if err != nil {
 		return errorResponse(err)
 	}
 
-	cids := rep.PrefetchContents(ctx, contentIDs, req.Hint)
+	cids := rep.PrefetchContents(ctx, contentIDs, req.GetHint())
 
 	return &grpcapi.SessionResponse{
 		Response: &grpcapi.SessionResponse_PrefetchContents{
@@ -463,7 +463,7 @@ func handleApplyRetentionPolicyRequest(ctx context.Context, rep repo.RepositoryW
 		manifest.TypeLabelKey:  snapshot.ManifestType,
 		snapshot.UsernameLabel: username,
 		snapshot.HostnameLabel: hostname,
-		snapshot.PathLabel:     req.SourcePath,
+		snapshot.PathLabel:     req.GetSourcePath(),
 	}) < auth.AccessLevelAppend {
 		return accessDeniedResponse()
 	}
@@ -471,8 +471,8 @@ func handleApplyRetentionPolicyRequest(ctx context.Context, rep repo.RepositoryW
 	manifestIDs, err := policy.ApplyRetentionPolicy(ctx, rep, snapshot.SourceInfo{
 		Host:     hostname,
 		UserName: username,
-		Path:     req.SourcePath,
-	}, req.ReallyDelete)
+		Path:     req.GetSourcePath(),
+	}, req.GetReallyDelete())
 	if err != nil {
 		return errorResponse(err)
 	}
diff --git a/repo/api_server_repository.go b/repo/api_server_repository.go
index 07173b37..8233980d 100644
--- a/repo/api_server_repository.go
+++ b/repo/api_server_repository.go
@@ -188,6 +188,7 @@ func (r *apiServerRepository) NewWriter(ctx context.Context, opt WriteSessionOpt
 func (r *apiServerRepository) ContentInfo(ctx context.Context, contentID content.ID) (content.Info, error) {
 	var bi content.Info
 
+	//nolint:goconst
 	if err := r.cli.Get(ctx, "contents/"+contentID.String()+"?info=1", content.ErrContentNotFound, &bi); err != nil {
 		return content.Info{}, errors.Wrap(err, "ContentInfo")
 	}
diff --git a/repo/content/committed_read_manager.go b/repo/content/committed_read_manager.go
index bde6a84f..3b8cd987 100644
--- a/repo/content/committed_read_manager.go
+++ b/repo/content/committed_read_manager.go
@@ -67,7 +67,7 @@
 
 // IndexBlobReader provides an API for reading index blobs.
 type IndexBlobReader interface {
-	ListIndexBlobInfos(context.Context) ([]indexblob.Metadata, time.Time, error)
+	ListIndexBlobInfos(ctx context.Context) ([]indexblob.Metadata, time.Time, error)
 }
 
 // SharedManager is responsible for read-only access to committed data.
diff --git a/repo/grpc_repository_client.go b/repo/grpc_repository_client.go
index 3f925850..f6ef3ef9 100644
--- a/repo/grpc_repository_client.go
+++ b/repo/grpc_repository_client.go
@@ -113,16 +113,16 @@ func (r *grpcInnerSession) readLoop(ctx context.Context) {
 
 	for ; err == nil; msg, err = r.cli.Recv() {
 		r.activeRequestsMutex.Lock()
-		ch := r.activeRequests[msg.RequestId]
+		ch := r.activeRequests[msg.GetRequestId()]
 
-		if !msg.HasMore {
-			delete(r.activeRequests, msg.RequestId)
+		if !msg.GetHasMore() {
+			delete(r.activeRequests, msg.GetRequestId())
 		}
 
 		r.activeRequestsMutex.Unlock()
 
 		ch <- msg
-		if !msg.HasMore {
+		if !msg.GetHasMore() {
 			close(ch)
 		}
 	}
@@ -163,7 +163,7 @@ func (r *grpcInnerSession) sendRequest(ctx context.Context, req *apipb.SessionRe
 
 		req.TraceContext = map[string]string{}
 
-		tc.Inject(ctx, propagation.MapCarrier(req.TraceContext))
+		tc.Inject(ctx, propagation.MapCarrier(req.GetTraceContext()))
 	}
 
 	// sends to GRPC stream must be single-threaded.
@@ -242,7 +242,7 @@ func (r *grpcInnerSession) initializeSession(ctx context.Context, purpose string
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_InitializeSession:
 			return rr.InitializeSession.GetParameters(), nil
 
@@ -268,7 +268,7 @@ func (r *grpcInnerSession) GetManifest(ctx context.Context, id manifest.ID, data
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_GetManifest:
 			return decodeManifestEntryMetadata(rr.GetManifest.GetMetadata()), json.Unmarshal(rr.GetManifest.GetJsonData(), data)
 
@@ -290,8 +290,8 @@ func appendManifestEntryMetadataList(result []*manifest.EntryMetadata, md []*api
 
 func decodeManifestEntryMetadata(md *apipb.ManifestEntryMetadata) *manifest.EntryMetadata {
 	return &manifest.EntryMetadata{
-		ID:      manifest.ID(md.Id),
-		Length:  int(md.Length),
+		ID:      manifest.ID(md.GetId()),
+		Length:  int(md.GetLength()),
 		Labels:  md.GetLabels(),
 		ModTime: time.Unix(0, md.GetModTimeNanos()),
 	}
@@ -322,7 +322,7 @@ func (r *grpcInnerSession) PutManifest(ctx context.Context, labels map[string]st
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_PutManifest:
 			return manifest.ID(rr.PutManifest.GetManifestId()), nil
 
@@ -355,7 +355,7 @@ func (r *grpcInnerSession) FindManifests(ctx context.Context, labels map[string]
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_FindManifests:
 			entries = appendManifestEntryMetadataList(entries, rr.FindManifests.GetMetadata())
 
@@ -387,7 +387,7 @@ func (r *grpcInnerSession) DeleteManifest(ctx context.Context, id manifest.ID) e
 			},
 		},
 	}) {
-		switch resp.Response.(type) {
+		switch resp.GetResponse().(type) {
 		case *apipb.SessionResponse_DeleteManifest:
 			return nil
 
@@ -421,9 +421,9 @@ func (r *grpcInnerSession) PrefetchContents(ctx context.Context, contentIDs []co
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_PrefetchContents:
-			ids, err := content.IDsFromStrings(rr.PrefetchContents.ContentIds)
+			ids, err := content.IDsFromStrings(rr.PrefetchContents.GetContentIds())
 			if err != nil {
 				log(ctx).Warnf("invalid response to PrefetchContents: %v", err)
 			}
@@ -456,9 +456,9 @@ func (r *grpcInnerSession) ApplyRetentionPolicy(ctx context.Context, sourcePath
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_ApplyRetentionPolicy:
-			return manifest.IDsFromStrings(rr.ApplyRetentionPolicy.ManifestIds), nil
+			return manifest.IDsFromStrings(rr.ApplyRetentionPolicy.GetManifestIds()), nil
 
 		default:
 			return nil, unhandledSessionResponse(resp)
@@ -504,7 +504,7 @@ func (r *grpcInnerSession) Flush(ctx context.Context) error {
 			Flush: &apipb.FlushRequest{},
 		},
 	}) {
-		switch resp.Response.(type) {
+		switch resp.GetResponse().(type) {
 		case *apipb.SessionResponse_Flush:
 			return nil
 
@@ -588,7 +588,7 @@ func (r *grpcInnerSession) contentInfo(ctx context.Context, contentID content.ID
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_GetContentInfo:
 			contentID, err := content.ParseID(rr.GetContentInfo.GetInfo().GetId())
 			if err != nil {
@@ -623,9 +623,9 @@ func errorFromSessionResponse(rr *apipb.ErrorResponse) error {
 	case apipb.ErrorResponse_CONTENT_NOT_FOUND:
 		return content.ErrContentNotFound
 	case apipb.ErrorResponse_STREAM_BROKEN:
-		return errors.Wrap(io.EOF, rr.Message)
+		return errors.Wrap(io.EOF, rr.GetMessage())
 	default:
-		return errors.New(rr.Message)
+		return errors.New(rr.GetMessage())
 	}
 }
 
@@ -670,7 +670,7 @@ func (r *grpcInnerSession) GetContent(ctx context.Context, contentID content.ID)
 			},
 		},
 	}) {
-		switch rr := resp.Response.(type) {
+		switch rr := resp.GetResponse().(type) {
 		case *apipb.SessionResponse_GetContent:
 			return rr.GetContent.GetData(), nil
 
@@ -758,7 +758,7 @@ func (r *grpcInnerSession) WriteContentAsyncAndVerify(ctx context.Context, conte
 
 	eg.Go(func() error {
 		for resp := range ch {
-			switch rr := resp.Response.(type) {
+			switch rr := resp.GetResponse().(type) {
 			case *apipb.SessionResponse_WriteContent:
 				got, err := content.ParseID(rr.WriteContent.GetContentId())
 				if err != nil {
@@ -962,10 +962,10 @@ func newGRPCAPIRepositoryForConnection(
 		rr.h = hf
 
 		rr.objectFormat = format.ObjectFormat{
-			Splitter: p.Splitter,
+			Splitter: p.GetSplitter(),
 		}
 
-		rr.serverSupportsContentCompression = p.SupportsContentCompression
+		rr.serverSupportsContentCompression = p.GetSupportsContentCompression()
 
 		rr.omgr, err = object.NewObjectManager(ctx, rr, rr.objectFormat, rr.metricsRegistry)
 		if err != nil {
diff --git a/repo/logging/logging_buf.go b/repo/logging/logging_buf.go
index 37fd8272..8829d044 100644
--- a/repo/logging/logging_buf.go
+++ b/repo/logging/logging_buf.go
@@ -1,7 +1,6 @@
 package logging
 
 import (
-	"reflect"
 	"strconv"
 	"sync"
 	"time"
@@ -134,15 +133,10 @@ func (b *Buffer) AppendUint(val uint64, base int) *Buffer {
 
 // String returns a string value of a buffer. The value is valud as long as
 // string remains allocated and no Append*() methods have been called.
-func (b *Buffer) String() (s string) {
+func (b *Buffer) String() string {
 	if b.validLen == 0 {
 		return ""
 	}
 
-	// *reflect.StringHeader can't be constructed, so we refer to output variable here
-	shdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) //nolint:gosec
-	shdr.Data = uintptr(unsafe.Pointer(&b.buf))         //nolint:gosec
-	shdr.Len = b.validLen
-
-	return
+	return unsafe.String(&b.buf[0], b.validLen) //nolint:gosec
 }
diff --git a/snapshot/policy/retention_policy.go b/snapshot/policy/retention_policy.go
index 8d5ea18b..79b94be7 100644
--- a/snapshot/policy/retention_policy.go
+++ b/snapshot/policy/retention_policy.go
@@ -143,7 +143,7 @@ func (r *RetentionPolicy) getRetentionReasons(i int, s *snapshot.Manifest, cutof
 		timePeriodType string
 		max            *OptionalInt
 	}{
-		{zeroTime, fmt.Sprintf("%v", i), "latest", effectiveKeepLatest},
+		{zeroTime, strconv.Itoa(i), "latest", effectiveKeepLatest},
 		{cutoff.annual, s.StartTime.Format("2006"), "annual", r.KeepAnnual},
 		{cutoff.monthly, s.StartTime.Format("2006-01"), "monthly", r.KeepMonthly},
 		{cutoff.weekly, fmt.Sprintf("%04v-%02v", yyyy, wk), "weekly", r.KeepWeekly},
diff --git a/snapshot/snapshotfs/upload_actions.go b/snapshot/snapshotfs/upload_actions.go
index b2619d3f..96068408 100644
--- a/snapshot/snapshotfs/upload_actions.go
+++ b/snapshot/snapshotfs/upload_actions.go
@@ -5,6 +5,7 @@
 	"bytes"
 	"context"
 	"crypto/rand"
+	"encoding/hex"
 	"fmt"
 	"os"
 	"os/exec"
@@ -66,7 +67,7 @@ func (hc *actionContext) ensureInitialized(ctx context.Context, actionType, dirP
 		return errors.Wrap(err, "error reading random bytes")
 	}
 
-	hc.SnapshotID = fmt.Sprintf("%x", randBytes[:])
+	hc.SnapshotID = hex.EncodeToString(randBytes[:])
 	hc.SourcePath = dirPathOrEmpty
 	hc.SnapshotPath = hc.SourcePath
 
diff --git a/tools/gettool/autodownload/autodownload.go b/tools/gettool/autodownload/autodownload.go
index e6fc5fff..583fa191 100644
--- a/tools/gettool/autodownload/autodownload.go
+++ b/tools/gettool/autodownload/autodownload.go
@@ -8,6 +8,7 @@
 	"bytes"
 	"compress/gzip"
 	"crypto/sha256"
+	"encoding/hex"
 	"fmt"
 	"io"
 	"log"
@@ -241,7 +242,7 @@ func downloadInternal(url, dir string, checksum map[string]string, stripPathComp
 		return errors.Wrap(cerr, "copy error")
 	}
 
-	actualChecksum := fmt.Sprintf("%x", h.Sum(nil))
+	actualChecksum := hex.EncodeToString(h.Sum(nil))
 
 	switch {
 	case checksum[url] == "":
diff --git a/tools/gettool/checksums.txt b/tools/gettool/checksums.txt
index f6b4a24b..cdf63cd1 100644
--- a/tools/gettool/checksums.txt
+++ b/tools/gettool/checksums.txt
@@ -7,12 +7,12 @@ https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.
 https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_darwin-universal.tar.gz: 1557f896f34743d241e1aecab588be273dde59692b362a9f4488231a2595b2ae
 https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_linux-amd64.tar.gz: e04bccfa81df6c727f1c03bc858eb21d6f95123d311cafe245f4485d289123f3
 https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_windows-amd64.zip: 3eabfbfad1431939058e6f7e76573c6bac1fee92f3a7b1ac5739c555940f0e0e
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-darwin-amd64.tar.gz: 0a76fcb91bca94c0b3bcb931662eafd320fbe458b3a29ce368b0bffbd4eff2fb
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-darwin-arm64.tar.gz: aeb77a00c24720e223ef73da18eea3afb29ea46356db33e1f503c66f2799d387
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-linux-amd64.tar.gz: a694f19dbfab3ea4d3956cb105d2e74c1dc49cb4c06ece903a3c534bce86b3dc
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-linux-arm64.tar.gz: c25165722b7c12ba7d72a15c3dd838e556ba23f24b2857309cbae9c4067d47a7
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-linux-armv6.tar.gz: cf789c827da074fc0418b73f6605f44c6e3715d530f9015f75690a9e6441112e
-https://github.com/golangci/golangci-lint/releases/download/v1.54.0/golangci-lint-1.54.0-windows-amd64.zip: 8ff567bfe2add55764b983826ca83a9ef9cf063075f36f4818ddc1c73ed62e6d
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-darwin-amd64.tar.gz: 632e96e6d5294fbbe7b2c410a49c8fa01c60712a0af85a567de85bcc1623ea21
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-darwin-arm64.tar.gz: 234463f059249f82045824afdcdd5db5682d0593052f58f6a3039a0a1c3899f6
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-linux-amd64.tar.gz: ca21c961a33be3bc15e4292dc40c98c8dcc5463a7b6768a3afc123761630c09c
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-linux-arm64.tar.gz: 8eb0cee9b1dbf0eaa49871798c7f8a5b35f2960c52d776a5f31eb7d886b92746
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-linux-armv6.tar.gz: 3195f3e0f37d353fd5bd415cabcd4e263f5c29d3d0ffb176c26ff3d2c75eb3bb
+https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-windows-amd64.zip: f57d434d231d43417dfa631587522f8c1991220b43c8ffadb9c7bd279508bf81
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_arm64.tar.gz: 1f95e6561974f4766d8833438b646b06930563ca9867447ea03edb623d876c75
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_x86_64.tar.gz: 17ecad881a50e32f033da5a200c8417d37cae70f09e925645452937998aca506
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Linux_arm64.tar.gz: 8bf2a9b9e84498bfa239f2fe91b2d555642c87ab9d3f5d37f29e6e97116910a3
diff --git a/tools/tools.mk b/tools/tools.mk
index f47f0c39..13f8e4a9 100644
--- a/tools/tools.mk
+++ b/tools/tools.mk
@@ -102,7 +102,7 @@ retry:=
 endif
 
 # tool versions
-GOLANGCI_LINT_VERSION=1.54.0
+GOLANGCI_LINT_VERSION=1.55.2
 CHECKLOCKS_VERSION=e8c1fff214d0ecf02cfe5aa9c62d11174130c339
 NODE_VERSION=18.16.0
 HUGO_VERSION=0.113.0


Test patch:
diff --git a/cli/command_maintenance_set_test.go b/cli/command_maintenance_set_test.go
index 41dd22a6..efe12ea6 100644
--- a/cli/command_maintenance_set_test.go
+++ b/cli/command_maintenance_set_test.go
@@ -2,6 +2,7 @@
 
 import (
 	"testing"
+	"time"
 
 	"github.com/stretchr/testify/require"
 
@@ -69,15 +70,15 @@ func (s *formatSpecificTestSuite) TestInvalidExtendRetainOptions(t *testing.T) {
 	testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "maintenance", "info", "--json"), &mi)
 
 	require.True(t, mi.ExtendObjectLocks, "ExtendOjectLocks should be enabled.")
-	require.True(t, mi.FullCycle.Interval == 86340000000000, "maintenance-interval should be unchanged.")
+	require.Equal(t, mi.FullCycle.Interval, time.Duration(86340000000000), "maintenance-interval should be unchanged.")
 
 	// Cannot change retention_period when retention_period-full_maintenance_interval < 24h
 	e.RunAndExpectFailure(t, "repository", "set-parameters", "--retention-period", "47h")
 	testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "repo", "status", "--json"), &rs)
-	require.True(t, rs.BlobRetention.RetentionPeriod == 172800000000000, "retention-interval should be unchanged.")
+	require.Equal(t, rs.BlobRetention.RetentionPeriod, time.Duration(172800000000000), "retention-interval should be unchanged.")
 
 	// Can change retention_period when retention_period-full_maintenance_interval > 24h
 	e.RunAndExpectSuccess(t, "repository", "set-parameters", "--retention-period", "49h")
 	testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "repo", "status", "--json"), &rs)
-	require.True(t, rs.BlobRetention.RetentionPeriod == 176400000000000, "retention-interval should be unchanged.")
+	require.Equal(t, rs.BlobRetention.RetentionPeriod, time.Duration(176400000000000), "retention-interval should be unchanged.")
 }
diff --git a/cli/command_repository_create_test.go b/cli/command_repository_create_test.go
index 486b11af..f30670a6 100644
--- a/cli/command_repository_create_test.go
+++ b/cli/command_repository_create_test.go
@@ -32,13 +32,13 @@ func TestRepositoryCreateWithConfigFile(t *testing.T) {
 		Config: filesystem.Options{Path: env.RepoDir},
 	}
 	token, err := repo.EncodeToken("12345678", ci)
-	require.Nil(t, err)
+	require.NoError(t, err)
 
 	// expect failure before writing to file
 	_, stderr = env.RunAndExpectFailure(t, "repo", "create", "from-config", "--token-file", storageCfgFName)
 	require.Contains(t, strings.Join(stderr, "\n"), "can't connect to storage: unable to open token file")
 
-	require.Nil(t, os.WriteFile(storageCfgFName, []byte(token), 0o600))
+	require.NoError(t, os.WriteFile(storageCfgFName, []byte(token), 0o600))
 
 	defer os.Remove(storageCfgFName) //nolint:errcheck,gosec
 
@@ -54,7 +54,7 @@ func TestRepositoryCreateWithConfigFromStdin(t *testing.T) {
 		Config: filesystem.Options{Path: env.RepoDir},
 	}
 	token, err := repo.EncodeToken("12345678", ci)
-	require.Nil(t, err)
+	require.NoError(t, err)
 
 	// set stdin
 	runner.SetNextStdin(strings.NewReader(token))
diff --git a/cli/command_repository_upgrade_test.go b/cli/command_repository_upgrade_test.go
index 7ac1fe0f..7feccca0 100644
--- a/cli/command_repository_upgrade_test.go
+++ b/cli/command_repository_upgrade_test.go
@@ -1,7 +1,7 @@
 package cli_test
 
 import (
-	"fmt"
+	"strconv"
 	"testing"
 	"time"
 
@@ -418,7 +418,7 @@ func TestRepositoryUpgrade_checkIndexInfo(t *testing.T) {
 		},
 	}
 	for i, tc := range tcs {
-		t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
+		t.Run(strconv.Itoa(i), func(t *testing.T) {
 			report := cli.CheckIndexInfo(tc.indexInfo0, tc.indexInfo1)
 			require.Equal(t, len(report), len(tc.expectRegexs), "unexpected report length")
 			for i := range tc.expectRegexs {
diff --git a/cli/command_restore_test.go b/cli/command_restore_test.go
index 4df5bc5c..5027b7d1 100644
--- a/cli/command_restore_test.go
+++ b/cli/command_restore_test.go
@@ -52,11 +52,11 @@ func TestRestoreSnapshotMaxTime(t *testing.T) {
 func TestRestoreSnapshotFilter(t *testing.T) {
 	f, err := createSnapshotTimeFilter("latest")
 	require.NoError(t, err)
-	require.Equal(t, true, f(nil, 0, 2))
-	require.Equal(t, false, f(nil, 1, 2))
+	require.True(t, f(nil, 0, 2))
+	require.False(t, f(nil, 1, 2))
 
 	f, err = createSnapshotTimeFilter("oldest")
 	require.NoError(t, err)
-	require.Equal(t, false, f(nil, 0, 2))
-	require.Equal(t, true, f(nil, 1, 2))
+	require.False(t, f(nil, 0, 2))
+	require.True(t, f(nil, 1, 2))
 }
diff --git a/debug/debug_test.go b/debug/debug_test.go
index e5ee7dd8..b423a661 100644
--- a/debug/debug_test.go
+++ b/debug/debug_test.go
@@ -117,7 +117,7 @@ func TestDebug_newProfileConfigs(t *testing.T) {
 		t.Run(fmt.Sprintf("%d %s", i, tc.in), func(t *testing.T) {
 			pb := newProfileConfig(1<<10, tc.in)
 			require.NotNil(t, pb)                 // always not nil
-			require.Equal(t, pb.buf.Cap(), 1<<10) // bufsize is always 1024
+			require.Equal(t, 1<<10, pb.buf.Cap()) // bufsize is always 1024
 			v, ok := pb.GetValue(tc.key)
 			require.Equal(t, tc.ok, ok)
 			require.Equal(t, tc.expect, v)
diff --git a/fs/utc_timestamp_test.go b/fs/utc_timestamp_test.go
index 67cd2216..9e54a179 100644
--- a/fs/utc_timestamp_test.go
+++ b/fs/utc_timestamp_test.go
@@ -34,7 +34,7 @@ func TestUTCTimestamp(t *testing.T) {
 	require.Equal(t, fs.UTCTimestamp(1657476922656077568), y.TS)
 	require.Equal(t, "2022-07-10T18:15:22.656077568Z", y.TS.Format(time.RFC3339Nano))
 
-	require.True(t, fs.UTCTimestampFromTime(t0) < fs.UTCTimestampFromTime(t1))
+	require.Less(t, fs.UTCTimestampFromTime(t0), fs.UTCTimestampFromTime(t1))
 	require.True(t, fs.UTCTimestampFromTime(t0).Equal(fs.UTCTimestampFromTime(t0)))
 	require.False(t, fs.UTCTimestampFromTime(t0).Equal(fs.UTCTimestampFromTime(t1)))
 	require.True(t, fs.UTCTimestampFromTime(t0).Before(fs.UTCTimestampFromTime(t1)))
diff --git a/fs/virtualfs/virtualfs_test.go b/fs/virtualfs/virtualfs_test.go
index 6497edc7..ea7bcf4f 100644
--- a/fs/virtualfs/virtualfs_test.go
+++ b/fs/virtualfs/virtualfs_test.go
@@ -146,7 +146,7 @@ func TestStreamingDirectory(t *testing.T) {
 	assert.Len(t, entries, 1)
 
 	e := entries[0]
-	require.Equal(t, e.Name(), testFileName)
+	require.Equal(t, testFileName, e.Name())
 
 	// Read and compare data
 	reader, err := f.GetReader(testlogging.Context(t))
@@ -178,7 +178,7 @@ func TestStreamingDirectory_MultipleIterationsFails(t *testing.T) {
 	assert.Len(t, entries, 1)
 
 	_, err = fs.GetAllEntries(testlogging.Context(t), rootDir)
-	assert.Error(t, err)
+	require.Error(t, err)
 }
 
 var errCallback = errors.New("callback error")
@@ -198,5 +198,5 @@ func TestStreamingDirectory_ReturnsCallbackError(t *testing.T) {
 	err := fs.IterateEntries(testlogging.Context(t), rootDir, func(context.Context, fs.Entry) error {
 		return errCallback
 	})
-	assert.ErrorIs(t, err, errCallback)
+	require.ErrorIs(t, err, errCallback)
 }
diff --git a/internal/blobtesting/storage.go b/internal/blobtesting/storage.go
index cc495c14..a1df1426 100644
--- a/internal/blobtesting/storage.go
+++ b/internal/blobtesting/storage.go
@@ -13,5 +13,5 @@
 type RetentionStorage interface {
 	blob.Storage
 	TouchBlob(ctx context.Context, id blob.ID, threshold time.Duration) (time.Time, error)
-	GetRetention(context.Context, blob.ID) (blob.RetentionMode, time.Time, error)
+	GetRetention(ctx context.Context, id blob.ID) (blob.RetentionMode, time.Time, error)
 }
diff --git a/internal/cache/content_cache_test.go b/internal/cache/content_cache_test.go
index c7657221..09be374a 100644
--- a/internal/cache/content_cache_test.go
+++ b/internal/cache/content_cache_test.go
@@ -205,9 +205,9 @@ func verifyContentCache(t *testing.T, cc cache.ContentCache, cacheStorage blob.S
 		for _, tc := range cases {
 			err := cc.GetContent(ctx, tc.contentID, tc.blobID, tc.offset, tc.length, &v)
 			if tc.err == nil {
-				assert.NoErrorf(t, err, "tc.contentID: %v", tc.contentID)
+				require.NoErrorf(t, err, "tc.contentID: %v", tc.contentID)
 			} else {
-				assert.ErrorContainsf(t, err, tc.err.Error(), "tc.contentID: %v", tc.contentID)
+				require.ErrorContainsf(t, err, tc.err.Error(), "tc.contentID: %v", tc.contentID)
 			}
 			if got := v.ToByteSlice(); !bytes.Equal(got, tc.expected) {
 				t.Errorf("unexpected data for %v: %x, wanted %x", tc.contentID, got, tc.expected)
@@ -292,13 +292,13 @@ func TestCacheFailureToWrite(t *testing.T) {
 	defer v.Close()
 
 	err = cc.GetContent(ctx, "aa", "content-1", 0, 3, &v)
-	assert.NoError(t, err, "write failure wasn't ignored")
+	require.NoError(t, err, "write failure wasn't ignored")
 
 	got, want := v.ToByteSlice(), []byte{1, 2, 3}
-	assert.Equal(t, want, got, "unexpected value retrieved from cache")
+	require.Equal(t, want, got, "unexpected value retrieved from cache")
 
 	all, err := blob.ListAllBlobs(ctx, cacheStorage, "")
-	assert.NoError(t, err, "error listing cache")
+	require.NoError(t, err, "error listing cache")
 
 	require.Empty(t, all, "invalid test - cache was written")
 }
diff --git a/internal/cache/mutex_map_test.go b/internal/cache/mutex_map_test.go
index dfda2fc3..44cf31d6 100644
--- a/internal/cache/mutex_map_test.go
+++ b/internal/cache/mutex_map_test.go
@@ -9,7 +9,7 @@
 func TestMutexMap_ExclusiveLock(t *testing.T) {
 	var m mutexMap
 
-	require.Len(t, m.entries, 0)
+	require.Empty(t, m.entries)
 	m.exclusiveLock("foo")
 	require.Len(t, m.entries, 1)
 	require.False(t, m.tryExclusiveLock("foo"))
@@ -23,13 +23,13 @@ func TestMutexMap_ExclusiveLock(t *testing.T) {
 	m.exclusiveUnlock("foo")
 	require.Len(t, m.entries, 1)
 	m.exclusiveUnlock("bar")
-	require.Len(t, m.entries, 0)
+	require.Empty(t, m.entries)
 }
 
 func TestMutexMap_SharedLock(t *testing.T) {
 	var m mutexMap
 
-	require.Len(t, m.entries, 0)
+	require.Empty(t, m.entries)
 	m.sharedLock("foo")
 	require.Len(t, m.entries, 1)
 	m.sharedLock("foo")
diff --git a/internal/cache/persistent_lru_cache_test.go b/internal/cache/persistent_lru_cache_test.go
index 6012c9d9..c50a8372 100644
--- a/internal/cache/persistent_lru_cache_test.go
+++ b/internal/cache/persistent_lru_cache_test.go
@@ -196,7 +196,7 @@ func TestPersistentLRUCache_PutIgnoresStorageFailure(t *testing.T) {
 
 	require.False(t, pc.GetFull(ctx, "key", &tmp))
 
-	require.Equal(t, fs.NumCalls(blobtesting.MethodPutBlob), 1)
+	require.Equal(t, 1, fs.NumCalls(blobtesting.MethodPutBlob))
 }
 
 func TestPersistentLRUCache_SweepMinSweepAge(t *testing.T) {
diff --git a/internal/diff/diff_test.go b/internal/diff/diff_test.go
index 6c6df493..210f6b70 100644
--- a/internal/diff/diff_test.go
+++ b/internal/diff/diff_test.go
@@ -157,7 +157,7 @@ func TestCompareDifferentDirectories(t *testing.T) {
 
 	err = c.Compare(ctx, dir1, dir2)
 	require.NoError(t, err)
-	require.Equal(t, buf.String(), expectedOutput)
+	require.Equal(t, expectedOutput, buf.String())
 }
 
 func TestCompareDifferentDirectories_DirTimeDiff(t *testing.T) {
@@ -191,7 +191,7 @@ func TestCompareDifferentDirectories_DirTimeDiff(t *testing.T) {
 	expectedOutput := ". modification times differ:  2023-04-12 10:30:00 +0000 UTC 2022-04-12 10:30:00 +0000 UTC\n"
 	err = c.Compare(ctx, dir1, dir2)
 	require.NoError(t, err)
-	require.Equal(t, buf.String(), expectedOutput)
+	require.Equal(t, expectedOutput, buf.String())
 }
 
 func TestCompareDifferentDirectories_FileTimeDiff(t *testing.T) {
@@ -224,7 +224,7 @@ func TestCompareDifferentDirectories_FileTimeDiff(t *testing.T) {
 
 	err = c.Compare(ctx, dir1, dir2)
 	require.NoError(t, err)
-	require.Equal(t, buf.String(), expectedOutput)
+	require.Equal(t, expectedOutput, buf.String())
 }
 
 func createTestDirectory(name string, modtime time.Time, files ...fs.Entry) *testDirectory {
diff --git a/internal/gather/gather_bytes_test.go b/internal/gather/gather_bytes_test.go
index 79a9987c..c80cd026 100644
--- a/internal/gather/gather_bytes_test.go
+++ b/internal/gather/gather_bytes_test.go
@@ -156,7 +156,7 @@ func TestGatherBytesReadSeeker(t *testing.T) {
 
 	tmp.Append(buf)
 
-	require.Equal(t, len(buf), tmp.Length())
+	require.Len(t, buf, tmp.Length())
 
 	reader := tmp.inner.Reader()
 	defer reader.Close() //nolint:errcheck
diff --git a/internal/gather/gather_write_buffer_test.go b/internal/gather/gather_write_buffer_test.go
index 5a99aa71..b1208d34 100644
--- a/internal/gather/gather_write_buffer_test.go
+++ b/internal/gather/gather_write_buffer_test.go
@@ -84,7 +84,7 @@ func TestGatherWriteBufferContig(t *testing.T) {
 	// allocate more than contig allocator can provide
 	theCap := maxContiguousAllocator.chunkSize + 10
 	b := w.MakeContiguous(theCap)
-	require.Equal(t, theCap, len(b))
+	require.Len(t, b, theCap)
 	require.Equal(t, theCap, cap(b))
 }
 
@@ -118,7 +118,7 @@ func TestGatherWriteBufferMax(t *testing.T) {
 	}
 
 	// make sure we have 1 contiguous buffer
-	require.Equal(t, 1, len(b.Bytes().Slices))
+	require.Len(t, b.Bytes().Slices, 1)
 
 	// write 10Mx5 bytes
 	for i := 0; i < 10000000; i++ {
@@ -126,5 +126,5 @@ func TestGatherWriteBufferMax(t *testing.T) {
 	}
 
 	// 51M requires 4x16MB buffers
-	require.Equal(t, 4, len(b.Bytes().Slices))
+	require.Len(t, b.Bytes().Slices, 4)
 }
diff --git a/internal/iocopy/iocopy_test.go b/internal/iocopy/iocopy_test.go
index 063dd17b..2644508a 100644
--- a/internal/iocopy/iocopy_test.go
+++ b/internal/iocopy/iocopy_test.go
@@ -41,8 +41,8 @@ func TestCopy(t *testing.T) {
 
 	n, err := iocopy.Copy(dst, src)
 	require.NoError(t, err)
-	require.Equal(t, n, int64(lenTestBuf))
-	require.Equal(t, dst.String(), testBuf)
+	require.Equal(t, int64(lenTestBuf), n)
+	require.Equal(t, testBuf, dst.String())
 }
 
 func TestJustCopy(t *testing.T) {
@@ -52,7 +52,7 @@ func TestJustCopy(t *testing.T) {
 	err := iocopy.JustCopy(dst, src)
 	require.NoError(t, err)
 	require.NoError(t, err)
-	require.Equal(t, dst.String(), testBuf)
+	require.Equal(t, testBuf, dst.String())
 }
 
 func TestCopyError(t *testing.T) {
@@ -82,7 +82,7 @@ func TestCustomReader(t *testing.T) {
 	n, err := iocopy.Copy(dst, src)
 	require.NoError(t, err)
 	require.Equal(t, n, int64(lenTestBuf))
-	require.Equal(t, dst.String(), testBuf)
+	require.Equal(t, testBuf, dst.String())
 }
 
 type customWriter struct {
@@ -97,5 +97,5 @@ func TestCopyWithCustomReaderAndWriter(t *testing.T) {
 	n, err := iocopy.Copy(customDst, src)
 	require.NoError(t, err)
 	require.Equal(t, n, int64(lenTestBuf))
-	require.Equal(t, dst.String(), testBuf)
+	require.Equal(t, testBuf, dst.String())
 }
diff --git a/internal/logfile/logfile_test.go b/internal/logfile/logfile_test.go
index 220a9b00..2d867c88 100644
--- a/internal/logfile/logfile_test.go
+++ b/internal/logfile/logfile_test.go
@@ -81,7 +81,7 @@ func TestLoggingFlags(t *testing.T) {
 		}
 	}
 
-	require.Greater(t, len(stderr), 0)
+	require.NotEmpty(t, stderr)
 
 	// run command with --log-level=warning so no log error is produced on the console
 	_, stderr, err = env.Run(t, false, "snap", "create", dir1,
diff --git a/internal/metricid/metricid_test.go b/internal/metricid/metricid_test.go
index 8e06097f..60b2a401 100644
--- a/internal/metricid/metricid_test.go
+++ b/internal/metricid/metricid_test.go
@@ -34,6 +34,6 @@ func verifyMapping(t *testing.T, mapping *metricid.Mapping) {
 	}
 
 	// make sure we use consecurive numbers
-	require.Equal(t, maxv, len(id2name))
+	require.Len(t, id2name, maxv)
 	require.Equal(t, mapping.MaxIndex, maxv)
 }
diff --git a/internal/metrics/metric_test.go b/internal/metrics/metric_test.go
index 5c667044..41f12834 100644
--- a/internal/metrics/metric_test.go
+++ b/internal/metrics/metric_test.go
@@ -23,14 +23,14 @@ func mustFindMetric(t *testing.T, wantName string, wantType io_prometheus_client
 			continue
 		}
 
-		for _, l := range f.Metric {
-			if len(l.Label) != len(wantLabels) {
+		for _, l := range f.GetMetric() {
+			if len(l.GetLabel()) != len(wantLabels) {
 				continue
 			}
 
 			found := true
 
-			for _, lab := range l.Label {
+			for _, lab := range l.GetLabel() {
 				if wantLabels[lab.GetName()] != lab.GetValue() {
 					found = false
 				}
@@ -43,8 +43,8 @@ func mustFindMetric(t *testing.T, wantName string, wantType io_prometheus_client
 	}
 
 	for _, f := range mf {
-		for _, l := range f.Metric {
-			t.Logf("  %v %v %v", f.GetName(), f.GetType(), l.Label)
+		for _, l := range f.GetMetric() {
+			t.Logf("  %v %v %v", f.GetName(), f.GetType(), l.GetLabel())
 		}
 	}
 
diff --git a/internal/parallelwork/parallel_work_queue_test.go b/internal/parallelwork/parallel_work_queue_test.go
index 408e6fe7..f46db288 100644
--- a/internal/parallelwork/parallel_work_queue_test.go
+++ b/internal/parallelwork/parallel_work_queue_test.go
@@ -155,9 +155,9 @@ func TestProgressCallback(t *testing.T) {
 	close(progressUpdates)
 
 	for update := range progressUpdates {
-		require.True(t, update.enqueued >= 0)
-		require.True(t, update.active >= 0)
-		require.True(t, update.completed >= 0)
+		require.GreaterOrEqual(t, update.enqueued, int64(0))
+		require.GreaterOrEqual(t, update.active, int64(0))
+		require.GreaterOrEqual(t, update.completed, int64(0))
 	}
 }
 
@@ -179,19 +179,19 @@ func TestOnNthCompletion(t *testing.T) {
 		for i := 0; i < n-1; i++ {
 			err := onNthCompletion()
 			require.NoError(t, err)
-			require.Equal(t, callbackInvoked, 0)
+			require.Equal(t, 0, callbackInvoked)
 		}
 
 		// on n-th invocation
 		err := onNthCompletion()
 		require.Error(t, err)
 		require.ErrorIs(t, err, errCalled)
-		require.Equal(t, callbackInvoked, 1)
+		require.Equal(t, 1, callbackInvoked)
 
 		// call once again (after n-th invocation)
 		err = onNthCompletion()
 		require.NoError(t, err)
-		require.Equal(t, callbackInvoked, 1)
+		require.Equal(t, 1, callbackInvoked)
 	})
 
 	t.Run("concurrency-safe", func(t *testing.T) {
@@ -222,7 +222,7 @@ func TestOnNthCompletion(t *testing.T) {
 		close(results)
 
 		// callback must be called exactly 1 time
-		require.Equal(t, callbackInvoked.Load(), int32(1))
+		require.Equal(t, int32(1), callbackInvoked.Load())
 
 		var (
 			errCalledCount int
@@ -240,7 +240,7 @@ func TestOnNthCompletion(t *testing.T) {
 			require.ErrorIs(t, result, errCalled)
 		}
 
-		require.Equal(t, errCalledCount, 1)
-		require.Equal(t, noErrorCount, n)
+		require.Equal(t, 1, errCalledCount)
+		require.Equal(t, n, noErrorCount)
 	})
 }
diff --git a/internal/releasable/releaseable_tracker_test.go b/internal/releasable/releaseable_tracker_test.go
index 7e04338f..12f8b8ee 100644
--- a/internal/releasable/releaseable_tracker_test.go
+++ b/internal/releasable/releaseable_tracker_test.go
@@ -23,9 +23,9 @@ func TestReleaseable(t *testing.T) {
 	require.ErrorContains(t, releasable.Verify(), "found 1 \"some-kind\" resources that have not been released")
 
 	releasable.Released("some-kind", 2)
-	assert.Len(t, releasable.Active()["some-kind"], 0)
+	assert.Empty(t, releasable.Active()["some-kind"])
 	releasable.Released("some-kind", 2)
-	assert.Len(t, releasable.Active()["some-kind"], 0)
+	assert.Empty(t, releasable.Active()["some-kind"])
 
 	releasable.DisableTracking("some-kind")
 	require.NotContains(t, releasable.Active(), releasable.ItemKind("some-kind"))
diff --git a/internal/repodiag/log_manager_test.go b/internal/repodiag/log_manager_test.go
index 8f1f0810..ecf83bef 100644
--- a/internal/repodiag/log_manager_test.go
+++ b/internal/repodiag/log_manager_test.go
@@ -24,7 +24,7 @@ func TestLogManager_Enabled(t *testing.T) {
 	l := lm.NewLogger()
 	l.Infof("hello")
 
-	require.Len(t, d, 0)
+	require.Empty(t, d)
 	l.Sync()
 	w.Wait(ctx)
 
@@ -58,12 +58,12 @@ func TestLogManager_AutoFlush(t *testing.T) {
 
 	w.Wait(ctx)
 
-	require.Equal(t, 1, len(d))
+	require.Len(t, d, 1)
 
 	l.Sync()
 	w.Wait(ctx)
 
-	require.Equal(t, 2, len(d))
+	require.Len(t, d, 2)
 }
 
 func TestLogManager_NotEnabled(t *testing.T) {
@@ -76,12 +76,12 @@ func TestLogManager_NotEnabled(t *testing.T) {
 	l := lm.NewLogger()
 	l.Infof("hello")
 
-	require.Len(t, d, 0)
+	require.Empty(t, d)
 	l.Sync()
 	w.Wait(ctx)
 
 	// make sure log messages are not written
-	require.Len(t, d, 0)
+	require.Empty(t, d)
 }
 
 func TestLogManager_Null(t *testing.T) {
diff --git a/internal/testlogging/ctx.go b/internal/testlogging/ctx.go
index 06e0b75b..2fc235aa 100644
--- a/internal/testlogging/ctx.go
+++ b/internal/testlogging/ctx.go
@@ -12,9 +12,9 @@
 
 type testingT interface {
 	Helper()
-	Errorf(string, ...interface{})
-	Fatalf(string, ...interface{})
-	Logf(string, ...interface{})
+	Errorf(msg string, args ...any)
+	Fatalf(msg string, args ...any)
+	Logf(msg string, args ...any)
 }
 
 // Level specifies log level.
diff --git a/internal/tlsutil/tlsutil_test.go b/internal/tlsutil/tlsutil_test.go
index e9aa2706..42bec850 100644
--- a/internal/tlsutil/tlsutil_test.go
+++ b/internal/tlsutil/tlsutil_test.go
@@ -24,9 +24,9 @@ func TestGenerateServerCertificate(t *testing.T) {
 	require.NotNil(t, cert, "expected non-nil certificate")
 	require.NotNil(t, priv, "expected non-nil private key")
 	require.Len(t, cert.IPAddresses, 1)
-	require.Equal(t, cert.IPAddresses[0].String(), "127.0.0.1")
+	require.Equal(t, "127.0.0.1", cert.IPAddresses[0].String())
 	require.Len(t, cert.DNSNames, 1)
-	require.Equal(t, cert.DNSNames[0], "localhost")
+	require.Equal(t, "localhost", cert.DNSNames[0])
 	require.False(t, cert.NotBefore.After(clock.Now()), "certificate NotBefore is in the future")
 	require.False(t, cert.NotAfter.Before(clock.Now().Add(certValid-time.Minute)), "certificate NotAfter is too early")
 }
diff --git a/repo/blob/azure/azure_immu_test.go b/repo/blob/azure/azure_immu_test.go
index a430856d..29892007 100644
--- a/repo/blob/azure/azure_immu_test.go
+++ b/repo/blob/azure/azure_immu_test.go
@@ -98,7 +98,7 @@ func TestAzureStorageImmutabilityProtection(t *testing.T) {
 	var re *azcore.ResponseError
 
 	require.ErrorAs(t, err, &re)
-	require.Equal(t, re.ErrorCode, "ImmutabilityPolicyDeleteOnLockedPolicy")
+	require.Equal(t, "ImmutabilityPolicyDeleteOnLockedPolicy", re.ErrorCode)
 
 	err = st.DeleteBlob(ctx, dummyBlob)
 	require.NoError(t, err)
diff --git a/repo/blob/beforeop/beforeop_test.go b/repo/blob/beforeop/beforeop_test.go
index 28bc4647..4f3755f4 100644
--- a/repo/blob/beforeop/beforeop_test.go
+++ b/repo/blob/beforeop/beforeop_test.go
@@ -72,14 +72,14 @@ func(ctx context.Context, id blob.ID, opts *blob.PutOptions) error {
 	defer data.Close()
 
 	_ = r.GetBlob(testlogging.Context(t), "id", 0, 0, &data)
-	require.Equal(t, true, getBlobCbInvoked)
+	require.True(t, getBlobCbInvoked)
 
 	_ = r.PutBlob(testlogging.Context(t), "id", data.Bytes(), blob.PutOptions{})
-	require.Equal(t, true, putBlobCbInvoked)
+	require.True(t, putBlobCbInvoked)
 
 	_ = r.DeleteBlob(testlogging.Context(t), "id")
-	require.Equal(t, true, deleteBlobCbInvoked)
+	require.True(t, deleteBlobCbInvoked)
 
 	_, _ = r.GetMetadata(testlogging.Context(t), "id")
-	require.Equal(t, true, getBlobMetadataCbInvoked)
+	require.True(t, getBlobMetadataCbInvoked)
 }
diff --git a/repo/blob/s3/s3_storage_test.go b/repo/blob/s3/s3_storage_test.go
index ebefd771..f540e628 100644
--- a/repo/blob/s3/s3_storage_test.go
+++ b/repo/blob/s3/s3_storage_test.go
@@ -484,8 +484,8 @@ func TestS3StorageMinioSTS(t *testing.T) {
 		DoNotUseTLS:     true,
 	})
 
-	require.NotEqual(t, kopiaCreds.AccessKeyID, minioRootAccessKeyID)
-	require.NotEqual(t, kopiaCreds.SecretAccessKey, minioRootSecretAccessKey)
+	require.NotEqual(t, minioRootAccessKeyID, kopiaCreds.AccessKeyID)
+	require.NotEqual(t, minioRootSecretAccessKey, kopiaCreds.SecretAccessKey)
 	require.NotEmpty(t, kopiaCreds.SessionToken)
 
 	testStorage(t, &Options{
diff --git a/repo/blob/storage_extend_test.go b/repo/blob/storage_extend_test.go
index cb069ad6..fad91143 100644
--- a/repo/blob/storage_extend_test.go
+++ b/repo/blob/storage_extend_test.go
@@ -126,5 +126,5 @@ func (s *formatSpecificTestSuite) TestExtendBlobRetentionUnsupported(t *testing.
 		RetentionMode:   blob.Governance,
 		RetentionPeriod: 2 * time.Hour,
 	})
-	assert.EqualErrorf(t, err, "object locking unsupported", "Storage should not support ExtendBlobRetention")
+	require.EqualErrorf(t, err, "object locking unsupported", "Storage should not support ExtendBlobRetention")
 }
diff --git a/repo/blob/throttling/throttling_storage_test.go b/repo/blob/throttling/throttling_storage_test.go
index c6d7cff1..2066556a 100644
--- a/repo/blob/throttling/throttling_storage_test.go
+++ b/repo/blob/throttling/throttling_storage_test.go
@@ -123,7 +123,7 @@ func TestThrottling(t *testing.T) {
 	m.Reset()
 
 	_, err := wrapped.GetMetadata(ctx, "blob1")
-	require.NoError(t, err, blob.ErrBlobNotFound)
+	require.NoError(t, err)
 	require.Equal(t, []string{
 		"BeforeOperation(GetMetadata)",
 		"inner.GetMetadata",
diff --git a/repo/content/content_manager_test.go b/repo/content/content_manager_test.go
index fc86242f..26404088 100644
--- a/repo/content/content_manager_test.go
+++ b/repo/content/content_manager_test.go
@@ -2094,7 +2094,7 @@ func (s *contentManagerSuite) TestCompression_NonCompressibleData(t *testing.T)
 	require.NoError(t, err)
 
 	// verify compression did not occur
-	require.True(t, ci.GetPackedLength() > ci.GetOriginalLength())
+	require.Greater(t, ci.GetPackedLength(), ci.GetOriginalLength())
 	require.Equal(t, uint32(len(nonCompressibleData)), ci.GetOriginalLength())
 	require.Equal(t, NoCompression, ci.GetCompressionHeaderID())
 
diff --git a/repo/content/index/merged_test.go b/repo/content/index/merged_test.go
index adce9bcf..2fb621ae 100644
--- a/repo/content/index/merged_test.go
+++ b/repo/content/index/merged_test.go
@@ -38,7 +38,7 @@ func TestMerged(t *testing.T) {
 
 	m := Merged{i1, i2, i3}
 
-	require.Equal(t, m.ApproximateCount(), 11)
+	require.Equal(t, 11, m.ApproximateCount())
 
 	i, err := m.GetInfo(mustParseID(t, "aabbcc"))
 	require.NoError(t, err)
diff --git a/repo/content/index/packindex_test.go b/repo/content/index/packindex_test.go
index d3454b39..2e1f5518 100644
--- a/repo/content/index/packindex_test.go
+++ b/repo/content/index/packindex_test.go
@@ -3,6 +3,7 @@
 import (
 	"bytes"
 	"crypto/sha1"
+	"encoding/hex"
 	"fmt"
 	"io"
 	"math/rand"
@@ -47,7 +48,7 @@ func deterministicPackBlobID(id int) blob.ID {
 	h := sha1.New()
 	fmt.Fprintf(h, "%v", id)
 
-	return blob.ID(fmt.Sprintf("%x", h.Sum(nil)))
+	return blob.ID(hex.EncodeToString(h.Sum(nil)))
 }
 
 func deterministicPackedOffset(id int) uint32 {
@@ -391,7 +392,7 @@ func TestPackIndexV2TooManyUniqueFormats(t *testing.T) {
 
 	err := b.buildV2(io.Discard)
 	require.Error(t, err)
-	require.Equal(t, err.Error(), "unsupported - too many unique formats 256 (max 255)")
+	require.Equal(t, "unsupported - too many unique formats 256 (max 255)", err.Error())
 }
 
 func fuzzTestIndexOpen(originalData []byte) {
diff --git a/repo/ecc/ecc_rs_crc_test.go b/repo/ecc/ecc_rs_crc_test.go
index 66f8ddc7..4cefcab5 100644
--- a/repo/ecc/ecc_rs_crc_test.go
+++ b/repo/ecc/ecc_rs_crc_test.go
@@ -27,9 +27,9 @@ func Test_RsCrc32_AssertSizeAlwaysGrow(t *testing.T) {
 		// println(fmt.Sprintf("%-8v -> b:%-4v s:%-8v t:%-8v", i, sizes.Blocks, sizes.ShardSize, total))
 
 		if sizes.StorePadding {
-			require.True(t, total >= last)
+			require.GreaterOrEqual(t, total, last)
 		} else {
-			require.True(t, total > last)
+			require.Greater(t, total, last)
 		}
 
 		sizes2 := impl.computeSizesFromStored(total)
diff --git a/repo/ecc/ecc_utils_test.go b/repo/ecc/ecc_utils_test.go
index 41d654f8..f87803c7 100644
--- a/repo/ecc/ecc_utils_test.go
+++ b/repo/ecc/ecc_utils_test.go
@@ -47,7 +47,7 @@ func testPutAndGet(t *testing.T, opts *Options, originalSize,
 	require.NoError(t, err)
 
 	result := output.ToByteSlice()
-	require.Equal(t, originalSize+expectedEccSize, len(result))
+	require.Len(t, result, originalSize+expectedEccSize)
 
 	makeChanges(impl, result)
 
diff --git a/repo/format/format_manager_test.go b/repo/format/format_manager_test.go
index 8942cee8..69e9335c 100644
--- a/repo/format/format_manager_test.go
+++ b/repo/format/format_manager_test.go
@@ -71,7 +71,7 @@ func TestFormatManager(t *testing.T) {
 	require.NotNil(t, mgr.HashFunc())
 	require.NotNil(t, mgr.Encryptor())
 	require.Equal(t, cf.MasterKey, mgr.GetMasterKey())
-	require.Equal(t, false, mgr.SupportsPasswordChange())
+	require.False(t, mgr.SupportsPasswordChange())
 	require.Equal(t, startTime, mgr.LoadedTime())
 	require.Equal(t, cf.MutableParameters, mustGetMutableParameters(t, mgr))
 	require.True(t, bytes.Contains(mustGetRepositoryFormatBytes(t, mgr), rawBytes))
diff --git a/repo/manifest/manifest_manager_test.go b/repo/manifest/manifest_manager_test.go
index bd28a4d0..f49f7884 100644
--- a/repo/manifest/manifest_manager_test.go
+++ b/repo/manifest/manifest_manager_test.go
@@ -10,7 +10,6 @@
 	"time"
 
 	"github.com/pkg/errors"
-	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
 	"github.com/kopia/kopia/internal/blobtesting"
@@ -488,5 +487,5 @@ func TestManifestAutoCompactionWithReadOnly(t *testing.T) {
 	require.NoError(t, err, "getting other instance of manifest manager")
 
 	_, err = mgr.Find(ctx, map[string]string{"color": "red"})
-	assert.NoError(t, err, "forcing reload of manifest manager")
+	require.NoError(t, err, "forcing reload of manifest manager")
 }
diff --git a/repo/manifest/serialized_test.go b/repo/manifest/serialized_test.go
index 1529adcc..74ac9902 100644
--- a/repo/manifest/serialized_test.go
+++ b/repo/manifest/serialized_test.go
@@ -61,7 +61,7 @@ func TestManifestDecode_BadInput(t *testing.T) {
 
 			t.Logf("%v", err)
 
-			assert.Error(t, err)
+			require.Error(t, err)
 		})
 	}
 }
diff --git a/repo/object/object_manager_test.go b/repo/object/object_manager_test.go
index db5f9958..5979a9a7 100644
--- a/repo/object/object_manager_test.go
+++ b/repo/object/object_manager_test.go
@@ -878,7 +878,7 @@ func TestWriterFlushFailure_OnWrite(t *testing.T) {
 
 	n, err := w.Write(bytes.Repeat([]byte{1, 2, 3, 4}, 1e6))
 	require.ErrorIs(t, err, errSomeError)
-	require.Equal(t, n, 0)
+	require.Equal(t, 0, n)
 }
 
 func TestWriterFlushFailure_OnFlush(t *testing.T) {
@@ -888,8 +888,8 @@ func TestWriterFlushFailure_OnFlush(t *testing.T) {
 	w := om.NewWriter(ctx, WriterOptions{})
 
 	n, err := w.Write(bytes.Repeat([]byte{1, 2, 3, 4}, 1e6))
-	require.NoError(t, err, errSomeError)
-	require.Equal(t, n, 4000000)
+	require.NoError(t, err)
+	require.Equal(t, 4000000, n)
 
 	fcm.writeContentError = errSomeError
 
@@ -922,8 +922,8 @@ func TestWriterFlushFailure_OnAsyncWrite(t *testing.T) {
 	fcm.writeContentError = errSomeError
 
 	n, err := w.Write(bytes.Repeat([]byte{1, 2, 3, 4}, 1e6))
-	require.NoError(t, err, errSomeError)
-	require.Equal(t, n, 4000000)
+	require.NotErrorIs(t, err, errSomeError)
+	require.Equal(t, 4000000, n)
 
 	_, err = w.Result()
 	require.ErrorIs(t, err, errSomeError)
@@ -954,5 +954,5 @@ func TestWriterFailure_OnCompression(t *testing.T) {
 	})
 
 	_, err := w.Write(bytes.Repeat([]byte{1, 2, 3, 4}, 1e6))
-	require.Error(t, err, errSomeError)
+	require.ErrorIs(t, err, errSomeError)
 }
diff --git a/repo/object/objectid_test.go b/repo/object/objectid_test.go
index 61560b62..943b9a0f 100644
--- a/repo/object/objectid_test.go
+++ b/repo/object/objectid_test.go
@@ -56,7 +56,7 @@ func TestFromStrings(t *testing.T) {
 	ids, err := IDsFromStrings([]string{"f0f0", "f1f1"})
 	require.NoError(t, err)
 
-	require.Equal(t, ids, []ID{mustParseID(t, "f0f0"), mustParseID(t, "f1f1")})
+	require.Equal(t, []ID{mustParseID(t, "f0f0"), mustParseID(t, "f1f1")}, ids)
 
 	_, err = IDsFromStrings([]string{"invalidf0f0", "f1f1"})
 	require.Error(t, err)
diff --git a/snapshot/snapshotfs/estimate_test.go b/snapshot/snapshotfs/estimate_test.go
index 4295b2be..d6e95e40 100644
--- a/snapshot/snapshotfs/estimate_test.go
+++ b/snapshot/snapshotfs/estimate_test.go
@@ -39,9 +39,9 @@ func (p *fakeProgress) Stats(
 		return
 	}
 
-	assert.Equal(p.t, s.ErrorCount, p.expectedErrors)
-	assert.Equal(p.t, s.TotalFileCount, p.expectedFiles)
-	assert.Equal(p.t, s.TotalDirectoryCount, p.expectedDirectories)
+	assert.Equal(p.t, p.expectedErrors, s.ErrorCount)
+	assert.Equal(p.t, p.expectedFiles, s.TotalFileCount)
+	assert.Equal(p.t, p.expectedDirectories, s.TotalDirectoryCount)
 }
 
 func TestEstimate_SkipsStreamingDirectory(t *testing.T) {
diff --git a/snapshot/snapshotfs/upload_test.go b/snapshot/snapshotfs/upload_test.go
index 37b9539a..b4d4d431 100644
--- a/snapshot/snapshotfs/upload_test.go
+++ b/snapshot/snapshotfs/upload_test.go
@@ -566,11 +566,11 @@ func TestUpload_FinishedFileProgress(t *testing.T) {
 			assert.Contains(t, []string{"f1", "f2"}, filepath.Base(relativePath))
 
 			if strings.Contains(relativePath, "f2") {
-				assert.Error(t, err)
+				require.Error(t, err)
 				return
 			}
 
-			assert.NoError(t, err)
+			require.NoError(t, err)
 		},
 	}
 
@@ -799,8 +799,8 @@ func TestUploadScanIgnoresFiles(t *testing.T) {
 	result2, err := u.scanDirectory(ctx, th.sourceDir, policyTree)
 	require.NoError(t, err)
 
-	require.NotEqual(t, result1.numFiles, 0)
-	require.NotEqual(t, result2.numFiles, 0)
+	require.NotEqual(t, 0, result1.numFiles)
+	require.NotEqual(t, 0, result2.numFiles)
 
 	require.Less(t, result2.numFiles, result1.numFiles)
 	require.Less(t, result2.totalFileSize, result1.totalFileSize)
@@ -997,10 +997,10 @@ func TestUpload_StreamingDirectory(t *testing.T) {
 	man, err := u.Upload(ctx, staticRoot, policyTree, snapshot.SourceInfo{})
 	require.NoError(t, err)
 
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.CachedFiles), int32(0))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.NonCachedFiles), int32(1))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.TotalDirectoryCount), int32(2))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.TotalFileCount), int32(1))
+	assert.Equal(t, int32(0), atomic.LoadInt32(&man.Stats.CachedFiles))
+	assert.Equal(t, int32(1), atomic.LoadInt32(&man.Stats.NonCachedFiles))
+	assert.Equal(t, int32(2), atomic.LoadInt32(&man.Stats.TotalDirectoryCount))
+	assert.Equal(t, int32(1), atomic.LoadInt32(&man.Stats.TotalFileCount))
 }
 
 func TestUpload_StreamingDirectoryWithIgnoredFile(t *testing.T) {
@@ -1036,10 +1036,10 @@ func TestUpload_StreamingDirectoryWithIgnoredFile(t *testing.T) {
 	man, err := u.Upload(ctx, staticRoot, policyTree, snapshot.SourceInfo{})
 	require.NoError(t, err)
 
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.CachedFiles), int32(0))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.NonCachedFiles), int32(1))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.TotalDirectoryCount), int32(2))
-	assert.Equal(t, atomic.LoadInt32(&man.Stats.TotalFileCount), int32(1))
+	assert.Equal(t, int32(0), atomic.LoadInt32(&man.Stats.CachedFiles))
+	assert.Equal(t, int32(1), atomic.LoadInt32(&man.Stats.NonCachedFiles))
+	assert.Equal(t, int32(2), atomic.LoadInt32(&man.Stats.TotalDirectoryCount))
+	assert.Equal(t, int32(1), atomic.LoadInt32(&man.Stats.TotalFileCount))
 }
 
 type mockLogger struct {
diff --git a/tests/end_to_end_test/acl_test.go b/tests/end_to_end_test/acl_test.go
index 6faa2b4f..bbdd5d7f 100644
--- a/tests/end_to_end_test/acl_test.go
+++ b/tests/end_to_end_test/acl_test.go
@@ -36,7 +36,7 @@ func verifyACL(t *testing.T, disableGRPC bool) {
 
 	serverEnvironment.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", serverEnvironment.RepoDir, "--override-hostname=foo", "--override-username=foo", "--enable-actions")
 
-	require.Len(t, serverEnvironment.RunAndExpectSuccess(t, "server", "acl", "list"), 0)
+	require.Empty(t, serverEnvironment.RunAndExpectSuccess(t, "server", "acl", "list"))
 
 	// enable ACLs - that should insert all the rules.
 	serverEnvironment.RunAndExpectSuccess(t, "server", "acl", "enable")
diff --git a/tests/end_to_end_test/api_server_repository_test.go b/tests/end_to_end_test/api_server_repository_test.go
index d4292387..db1a3281 100644
--- a/tests/end_to_end_test/api_server_repository_test.go
+++ b/tests/end_to_end_test/api_server_repository_test.go
@@ -387,7 +387,7 @@ func TestFindManifestsPaginationOverGRPC(t *testing.T) {
 	})
 
 	require.NoError(t, ferr)
-	require.Equal(t, numManifests, len(manifests))
+	require.Len(t, manifests, numManifests)
 
 	// make sure every manifest is unique and in the uniqueIDs map
 	for _, m := range manifests {
diff --git a/tests/end_to_end_test/ecc_test.go b/tests/end_to_end_test/ecc_test.go
index 36217e1b..5808c696 100644
--- a/tests/end_to_end_test/ecc_test.go
+++ b/tests/end_to_end_test/ecc_test.go
@@ -40,7 +40,7 @@ func (s *formatSpecificTestSuite) TestNoECC(t *testing.T) {
 	repoSize, err := dirSize(e.RepoDir)
 	require.NoError(t, err)
 
-	require.True(t, repoSize < int64(math.Round(1.1*mb)))
+	require.Less(t, repoSize, int64(math.Round(1.1*mb)))
 }
 
 func (s *formatSpecificTestSuite) TestECC(t *testing.T) {
@@ -73,11 +73,11 @@ func (s *formatSpecificTestSuite) TestECC(t *testing.T) {
 
 	// ECC is not supported in version 1
 	if s.formatVersion == 1 {
-		require.True(t, repoSize < int64(math.Round(1.1*mb)))
+		require.Less(t, repoSize, int64(math.Round(1.1*mb)))
 		return
 	}
 
-	require.True(t, repoSize >= int64(math.Round(1.5*mb)))
+	require.GreaterOrEqual(t, repoSize, int64(math.Round(1.5*mb)))
 
 	err = s.flipOneByteFromEachFile(e)
 	require.NoError(t, err)
diff --git a/tests/end_to_end_test/snapshot_actions_test.go b/tests/end_to_end_test/snapshot_actions_test.go
index 90642b78..ec102f3d 100644
--- a/tests/end_to_end_test/snapshot_actions_test.go
+++ b/tests/end_to_end_test/snapshot_actions_test.go
@@ -70,8 +70,8 @@ func TestSnapshotActionsBeforeSnapshotRoot(t *testing.T) {
 	// make sure snapshot IDs are different between two attempts
 	require.NotEqual(t, env1["KOPIA_SNAPSHOT_ID"], env2["KOPIA_SNAPSHOT_ID"], "KOPIA_SNAPSHOT_ID passed to action was not different between runs")
 
-	require.Equal(t, env1["KOPIA_ACTION"], "before-snapshot-root")
-	require.Equal(t, env3["KOPIA_ACTION"], "after-snapshot-root")
+	require.Equal(t, "before-snapshot-root", env1["KOPIA_ACTION"])
+	require.Equal(t, "after-snapshot-root", env3["KOPIA_ACTION"])
 	require.NotEmpty(t, env1["KOPIA_VERSION"])
 	require.NotEmpty(t, env3["KOPIA_VERSION"])
 
@@ -238,10 +238,9 @@ func TestSnapshotActionsBeforeAfterFolder(t *testing.T) {
 	env1 := mustReadEnvFile(t, envFile1)
 	env2 := mustReadEnvFile(t, envFile2)
 
-	require.Equal(t, env1["KOPIA_ACTION"], "before-folder")
-	require.Equal(t, env2["KOPIA_ACTION"], "after-folder")
-	require.Equal(t, env1["KOPIA_SOURCE_PATH"], sd2)
-	require.Equal(t, env2["KOPIA_SOURCE_PATH"], sd2)
+	require.Equal(t, "before-folder", env1["KOPIA_ACTION"])
+	require.Equal(t, "after-folder", env2["KOPIA_ACTION"])
+	require.Equal(t, sd2, env1["KOPIA_SOURCE_PATH"])
 	require.NotEmpty(t, env1["KOPIA_VERSION"])
 	require.NotEmpty(t, env2["KOPIA_VERSION"])
 
diff --git a/tests/htmlui_e2e_test/htmlui_e2e_test.go b/tests/htmlui_e2e_test/htmlui_e2e_test.go
index b3f59812..ab880fe0 100644
--- a/tests/htmlui_e2e_test/htmlui_e2e_test.go
+++ b/tests/htmlui_e2e_test/htmlui_e2e_test.go
@@ -12,7 +12,6 @@
 	"github.com/chromedp/cdproto/page"
 	"github.com/chromedp/chromedp"
 	"github.com/chromedp/chromedp/kb"
-	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
 	"github.com/kopia/kopia/internal/testutil"
@@ -91,8 +90,8 @@ func runInBrowser(t *testing.T, run func(ctx context.Context, sp *testutil.Serve
 			t.Logf("dialog opening: %v", do.Message)
 
 			go func() {
-				assert.Equal(t, tc.expectedDialogText, do.Message)
-				assert.NoError(t, chromedp.Run(ctx, page.HandleJavaScriptDialog(tc.dialogResponse)))
+				require.Equal(t, tc.expectedDialogText, do.Message)
+				require.NoError(t, chromedp.Run(ctx, page.HandleJavaScriptDialog(tc.dialogResponse)))
 				tc.expectedDialogText = ""
 			}()
 		}
@@ -117,13 +116,13 @@ func createTestSnapshot(t *testing.T, ctx context.Context, sp *testutil.ServerPa
 	f, err := os.Create(filepath.Join(snap1Path, "big.file"))
 
 	// assert that no error occurred
-	assert.Nil(t, err)
+	require.NoError(t, err)
 
 	// truncate file to 10 mb
 	err = f.Truncate(1e7)
 
 	// assert that no error occurred
-	assert.Nil(t, err)
+	require.NoError(t, err)
 
 	// create test repository
 	require.NoError(t, chromedp.Run(ctx,
diff --git a/tests/robustness/multiclient_test/framework/harness.go b/tests/robustness/multiclient_test/framework/harness.go
index 3ca3765a..36037f03 100644
--- a/tests/robustness/multiclient_test/framework/harness.go
+++ b/tests/robustness/multiclient_test/framework/harness.go
@@ -7,10 +7,10 @@
 	"context"
 	"errors"
 	"flag"
-	"fmt"
 	"log"
 	"os"
 	"path"
+	"strconv"
 	"syscall"
 	"testing"
 
@@ -213,7 +213,7 @@ func (th *TestHarness) Run( //nolint:thelper
 			ctx := ctx
 			testNum++
 
-			t.Run(fmt.Sprint(testNum), func(t *testing.T) {
+			t.Run(strconv.Itoa(testNum), func(t *testing.T) {
 				t.Parallel()
 				f(ctx, t)
 			})
diff --git a/tests/robustness/multiclient_test/multiclient_test.go b/tests/robustness/multiclient_test/multiclient_test.go
index cf31ad14..ab7bb73d 100644
--- a/tests/robustness/multiclient_test/multiclient_test.go
+++ b/tests/robustness/multiclient_test/multiclient_test.go
@@ -7,7 +7,6 @@
 	"context"
 	"errors"
 	"flag"
-	"fmt"
 	"strconv"
 	"testing"
 	"time"
@@ -142,7 +141,7 @@ func TestRandomizedSmall(t *testing.T) {
 			string(engine.DeleteRandomSubdirectoryActionKey): strconv.Itoa(1),
 		},
 		engine.WriteRandomFilesActionKey: map[string]string{
-			fiofilewriter.IOLimitPerWriteAction:    fmt.Sprintf("%d", 512*1024*1024),
+			fiofilewriter.IOLimitPerWriteAction:    strconv.Itoa(512 * 1024 * 1024),
 			fiofilewriter.MaxNumFilesPerWriteField: strconv.Itoa(100),
 			fiofilewriter.MaxFileSizeField:         strconv.Itoa(64 * 1024 * 1024),
 			fiofilewriter.MaxDirDepthField:         strconv.Itoa(3),
diff --git a/tests/robustness/robustness_test/robustness_test.go b/tests/robustness/robustness_test/robustness_test.go
index 635220e7..bbfe2a80 100644
--- a/tests/robustness/robustness_test/robustness_test.go
+++ b/tests/robustness/robustness_test/robustness_test.go
@@ -5,7 +5,6 @@
 
 import (
 	"errors"
-	"fmt"
 	"strconv"
 	"testing"
 
@@ -116,7 +115,7 @@ func TestRandomizedSmall(t *testing.T) {
 			string(engine.DeleteRandomSubdirectoryActionKey): strconv.Itoa(1),
 		},
 		engine.WriteRandomFilesActionKey: map[string]string{
-			fiofilewriter.IOLimitPerWriteAction:    fmt.Sprintf("%d", 512*1024*1024),
+			fiofilewriter.IOLimitPerWriteAction:    strconv.Itoa(512 * 1024 * 1024),
 			fiofilewriter.MaxNumFilesPerWriteField: strconv.Itoa(100),
 			fiofilewriter.MaxFileSizeField:         strconv.Itoa(64 * 1024 * 1024),
 			fiofilewriter.MaxDirDepthField:         strconv.Itoa(3),
diff --git a/tests/robustness/snapmeta/kopia_connector_test.go b/tests/robustness/snapmeta/kopia_connector_test.go
index 2c5a48e9..84e6b5eb 100644
--- a/tests/robustness/snapmeta/kopia_connector_test.go
+++ b/tests/robustness/snapmeta/kopia_connector_test.go
@@ -6,23 +6,23 @@
 import (
 	"testing"
 
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 )
 
 func TestKopiaConnector(t *testing.T) {
-	assert := assert.New(t) //nolint:gocritic
+	require := require.New(t) //nolint:gocritic
 
 	t.Setenv("KOPIA_EXE", "kopia.exe")
 
 	tc := &testConnector{}
 
 	err := tc.initializeConnector("")
-	assert.NoError(err)
-	assert.NotNil(tc.snap)
-	assert.NotNil(tc.initS3Fn)
-	assert.NotNil(tc.initS3WithServerFn)
-	assert.NotNil(tc.initFilesystemFn)
-	assert.NotNil(tc.initFilesystemWithServerFn)
+	require.NoError(err)
+	require.NotNil(tc.snap)
+	require.NotNil(tc.initS3Fn)
+	require.NotNil(tc.initS3WithServerFn)
+	require.NotNil(tc.initFilesystemFn)
+	require.NotNil(tc.initFilesystemWithServerFn)
 
 	tc.initS3Fn = tc.testInitS3
 	tc.initFilesystemFn = tc.testInitFilesystem
@@ -35,34 +35,34 @@ func TestKopiaConnector(t *testing.T) {
 	t.Setenv(EngineModeEnvKey, EngineModeBasic)
 	t.Setenv(S3BucketNameEnvKey, "")
 	tc.reset()
-	assert.NoError(tc.connectOrCreateRepo(repoPath))
-	assert.True(tc.initFilesystemCalled)
-	assert.Equal(repoPath, tc.tcRepoPath)
+	require.NoError(tc.connectOrCreateRepo(repoPath))
+	require.True(tc.initFilesystemCalled)
+	require.Equal(repoPath, tc.tcRepoPath)
 
 	t.Setenv(EngineModeEnvKey, EngineModeBasic)
 	t.Setenv(S3BucketNameEnvKey, bucketName)
 	tc.reset()
-	assert.NoError(tc.connectOrCreateRepo(repoPath))
-	assert.True(tc.initS3Called)
-	assert.Equal(repoPath, tc.tcRepoPath)
-	assert.Equal(bucketName, tc.tcBucketName)
+	require.NoError(tc.connectOrCreateRepo(repoPath))
+	require.True(tc.initS3Called)
+	require.Equal(repoPath, tc.tcRepoPath)
+	require.Equal(bucketName, tc.tcBucketName)
 
 	t.Setenv(EngineModeEnvKey, EngineModeServer)
 	t.Setenv(S3BucketNameEnvKey, "")
 	tc.reset()
-	assert.NoError(tc.connectOrCreateRepo(repoPath))
-	assert.True(tc.initFilesystemWithServerCalled)
-	assert.Equal(repoPath, tc.tcRepoPath)
-	assert.Equal(defaultAddr, tc.tcAddr)
+	require.NoError(tc.connectOrCreateRepo(repoPath))
+	require.True(tc.initFilesystemWithServerCalled)
+	require.Equal(repoPath, tc.tcRepoPath)
+	require.Equal(defaultAddr, tc.tcAddr)
 
 	t.Setenv(EngineModeEnvKey, EngineModeServer)
 	t.Setenv(S3BucketNameEnvKey, bucketName)
 	tc.reset()
-	assert.NoError(tc.connectOrCreateRepo(repoPath))
-	assert.True(tc.initS3WithServerCalled)
-	assert.Equal(repoPath, tc.tcRepoPath)
-	assert.Equal(bucketName, tc.tcBucketName)
-	assert.Equal(defaultAddr, tc.tcAddr)
+	require.NoError(tc.connectOrCreateRepo(repoPath))
+	require.True(tc.initS3WithServerCalled)
+	require.Equal(repoPath, tc.tcRepoPath)
+	require.Equal(bucketName, tc.tcBucketName)
+	require.Equal(defaultAddr, tc.tcAddr)
 }
 
 type testConnector struct {
diff --git a/tests/robustness/snapmeta/kopia_persister_light_test.go b/tests/robustness/snapmeta/kopia_persister_light_test.go
index 155f0619..b1eb3c09 100644
--- a/tests/robustness/snapmeta/kopia_persister_light_test.go
+++ b/tests/robustness/snapmeta/kopia_persister_light_test.go
@@ -6,9 +6,9 @@
 import (
 	"bytes"
 	"context"
-	"fmt"
 	"log"
 	"os"
+	"strconv"
 	"testing"
 )
 
@@ -49,7 +49,7 @@ func TestConcurrency(t *testing.T) {
 	t.Run("storeLoad", func(t *testing.T) {
 		for i := 0; i < 9; i++ {
 			j := i
-			t.Run(fmt.Sprint(i), func(t *testing.T) {
+			t.Run(strconv.Itoa(i), func(t *testing.T) {
 				t.Parallel()
 				kpl.testStoreLoad(ctx, t, keys[j%3], vals[j%3])
 			})
@@ -59,7 +59,7 @@ func TestConcurrency(t *testing.T) {
 	t.Run("delete", func(t *testing.T) {
 		for i := 0; i < 9; i++ {
 			j := i
-			t.Run(fmt.Sprint(i), func(t *testing.T) {
+			t.Run(strconv.Itoa(i), func(t *testing.T) {
 				t.Parallel()
 				kpl.testDelete(ctx, t, keys[j%3])
 			})
diff --git a/tests/testenv/cli_test_env.go b/tests/testenv/cli_test_env.go
index 79849218..fdd64054 100644
--- a/tests/testenv/cli_test_env.go
+++ b/tests/testenv/cli_test_env.go
@@ -124,7 +124,7 @@ func (e *CLITest) TweakFile(t *testing.T, dirn, fglob string) {
 	// find a file within the repository to corrupt
 	mch, err := fs.Glob(os.DirFS(dirn), fglob)
 	require.NoError(t, err)
-	require.Greater(t, len(mch), 0)
+	require.NotEmpty(t, mch)
 
 	// grab a random file in the directory dirn
 	fn := mch[rand.Intn(len(mch))]
diff --git a/tests/tools/fswalker/fswalker.go b/tests/tools/fswalker/fswalker.go
index 1eed0abe..a1f112eb 100644
--- a/tests/tools/fswalker/fswalker.go
+++ b/tests/tools/fswalker/fswalker.go
@@ -183,13 +183,13 @@ func isRootDirectoryRename(diffItem string, mod fswalker.ActionData) bool {
 
 	// The mod.Before.Path may be given from fswalker Report as "./", so
 	// clean it before compare
-	return mod.Before.Info.IsDir && filepath.Clean(mod.Before.Path) == "."
+	return mod.Before.GetInfo().GetIsDir() && filepath.Clean(mod.Before.GetPath()) == "."
 }
 
 // Directory size changes with underlying file system setups. Ignote the dir size during data consistency check to make it robust.
 // Remove this filter from GlobalFilterFuncs to detect the size difference in a directory.
 func filterDirSizeCheck(str string, mod fswalker.ActionData) bool {
-	return mod.Before.Info.IsDir && strings.Contains(str, "size: ")
+	return mod.Before.GetInfo().GetIsDir() && strings.Contains(str, "size: ")
 }
 
 func filterFileTimeDiffs(str string, mod fswalker.ActionData) bool {
@@ -201,8 +201,8 @@ func ignoreGIDIfZero(str string, mod fswalker.ActionData) bool {
 		return false
 	}
 
-	beforeGID := mod.Before.Stat.Gid
-	afterGID := mod.After.Stat.Gid
+	beforeGID := mod.Before.GetStat().GetGid()
+	afterGID := mod.After.GetStat().GetGid()
 
 	return beforeGID != afterGID && beforeGID == 0
 }
@@ -212,8 +212,8 @@ func ignoreUIDIfZero(str string, mod fswalker.ActionData) bool {
 		return false
 	}
 
-	beforeUID := mod.Before.Stat.Uid
-	afterUID := mod.After.Stat.Uid
+	beforeUID := mod.Before.GetStat().GetUid()
+	afterUID := mod.After.GetStat().GetUid()
 
 	return beforeUID != afterUID && beforeUID == 0
 }
@@ -239,10 +239,10 @@ func validateReport(report *fswalker.Report) error {
 }
 
 func rerootWalkDataPaths(walk *fspb.Walk, newRoot string) error {
-	for _, f := range walk.File {
+	for _, f := range walk.GetFile() {
 		var err error
 
-		f.Path, err = filepath.Rel(newRoot, f.Path)
+		f.Path, err = filepath.Rel(newRoot, f.GetPath())
 		if err != nil {
 			return err
 		}