Repository: kopia/kopia
Pull request #4250 (2024-11-16 04:35:12)

chore(ci): upgraded linter to 1.62.0


Patch:
diff --git a/.golangci.yml b/.golangci.yml
index a44e5ae7..92be8a1e 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -78,11 +78,9 @@ linters:
   enable-all: true
   disable:
     - depguard
-    - execinquery
     - exhaustruct
     - exportloopref
     - gochecknoinits
-    - gomnd
     - gci
     - ireturn # this one may be interesting to control allocations
     - gosmopolitan
diff --git a/cli/command_benchmark_compression.go b/cli/command_benchmark_compression.go
index 61a66726..40992089 100644
--- a/cli/command_benchmark_compression.go
+++ b/cli/command_benchmark_compression.go
@@ -195,7 +195,7 @@ func (c *commandBenchmarkCompression) runCompression(ctx context.Context, data [
 					continue
 				}
 
-				compressedSize = uint64(compressed.Len())
+				compressedSize = uint64(compressed.Len()) //nolint:gosec
 
 				if c.verifyStable {
 					h := hashOf(compressed.Bytes())
@@ -277,6 +277,7 @@ func (c *commandBenchmarkCompression) runDecompression(ctx context.Context, data
 				}
 			}
 
+			//nolint:gosec
 			return uint64(compressedInput.Length())
 		}
 
diff --git a/cli/command_benchmark_ecc.go b/cli/command_benchmark_ecc.go
index 8e0458a1..59e90dc8 100644
--- a/cli/command_benchmark_ecc.go
+++ b/cli/command_benchmark_ecc.go
@@ -70,6 +70,8 @@ func (c *commandBenchmarkEcc) runBenchmark(ctx context.Context) []eccBenchResult
 	var results []eccBenchResult
 
 	data := make([]byte, c.blockSize)
+
+	//nolint:gosec
 	for i := range uint64(c.blockSize) {
 		data[i] = byte(i%255 + 1)
 	}
diff --git a/cli/password.go b/cli/password.go
index dfbd0b40..be8a8994 100644
--- a/cli/password.go
+++ b/cli/password.go
@@ -97,7 +97,7 @@ func askPass(out io.Writer, prompt string) (string, error) {
 	for range 5 {
 		fmt.Fprint(out, prompt) //nolint:errcheck
 
-		passBytes, err := term.ReadPassword(int(os.Stdin.Fd())) //nolint:gosec
+		passBytes, err := term.ReadPassword(int(os.Stdin.Fd()))
 		if err != nil {
 			return "", errors.Wrap(err, "password prompt error")
 		}
diff --git a/cli/storage_filesystem.go b/cli/storage_filesystem.go
index 9d8068ce..bfd10b4b 100644
--- a/cli/storage_filesystem.go
+++ b/cli/storage_filesystem.go
@@ -92,7 +92,7 @@ func getIntPtrValue(value string, base int) *int {
 
 func getFileModeValue(value string, def os.FileMode) os.FileMode {
 	if uint32Val, err := strconv.ParseUint(value, 8, 32); err == nil {
-		return os.FileMode(uint32Val) //nolint:gosec
+		return os.FileMode(uint32Val)
 	}
 
 	return def
diff --git a/fs/localfs/local_fs_32bit.go b/fs/localfs/local_fs_32bit.go
index ca406e65..361b705c 100644
--- a/fs/localfs/local_fs_32bit.go
+++ b/fs/localfs/local_fs_32bit.go
@@ -5,5 +5,5 @@
 package localfs
 
 func platformSpecificWidenDev(dev int32) uint64 {
-	return uint64(dev)
+	return uint64(dev) //nolint:gosec
 }
diff --git a/fs/utc_timestamp.go b/fs/utc_timestamp.go
index be2797a0..faa91644 100644
--- a/fs/utc_timestamp.go
+++ b/fs/utc_timestamp.go
@@ -8,6 +8,8 @@
 )
 
 // UTCTimestamp stores the UTC timestamp in nanoseconds and provides JSON serializability.
+//
+//nolint:recvcheck
 type UTCTimestamp int64
 
 // UnmarshalJSON implements json.Unmarshaler.
diff --git a/internal/acl/access_level.go b/internal/acl/access_level.go
index ac694f39..9de5ec95 100644
--- a/internal/acl/access_level.go
+++ b/internal/acl/access_level.go
@@ -8,6 +8,8 @@
 )
 
 // AccessLevel specifies access level.
+//
+//nolint:recvcheck
 type AccessLevel int
 
 // accessLevelToString maps supported access levels to strings.
diff --git a/internal/bigmap/bigmapbench/main.go b/internal/bigmap/bigmapbench/main.go
index ab3f5749..760ada05 100644
--- a/internal/bigmap/bigmapbench/main.go
+++ b/internal/bigmap/bigmapbench/main.go
@@ -98,7 +98,7 @@ func main() {
 
 		// generate key=sha256(i) without allocations.
 		h.Reset()
-		binary.LittleEndian.PutUint64(num[:], uint64(i))
+		binary.LittleEndian.PutUint64(num[:], uint64(i)) //nolint:gosec
 		h.Write(num[:])
 		h.Sum(keyBuf[:0])
 
diff --git a/internal/cache/persistent_lru_cache.go b/internal/cache/persistent_lru_cache.go
index 8ce083bc..eb519f61 100644
--- a/internal/cache/persistent_lru_cache.go
+++ b/internal/cache/persistent_lru_cache.go
@@ -220,6 +220,8 @@ func (c *PersistentCache) Close(ctx context.Context) {
 }
 
 // A contentMetadataHeap implements heap.Interface and holds blob.Metadata.
+//
+//nolint:recvcheck
 type contentMetadataHeap struct {
 	data           []blob.Metadata
 	index          map[blob.ID]int
diff --git a/internal/epoch/epoch_utils.go b/internal/epoch/epoch_utils.go
index 07594025..545c61c4 100644
--- a/internal/epoch/epoch_utils.go
+++ b/internal/epoch/epoch_utils.go
@@ -108,7 +108,7 @@ func (r closedIntRange) length() uint {
 		return 0
 	}
 
-	return uint(r.hi - r.lo + 1)
+	return uint(r.hi - r.lo + 1) //nolint:gosec
 }
 
 func (r closedIntRange) isEmpty() bool {
diff --git a/internal/fusemount/fusefs.go b/internal/fusemount/fusefs.go
index 232d5fc6..8ef78fdc 100644
--- a/internal/fusemount/fusefs.go
+++ b/internal/fusemount/fusefs.go
@@ -50,8 +50,8 @@ func goModeToUnixMode(mode os.FileMode) uint32 {
 
 func populateAttributes(a *fuse.Attr, e fs.Entry) {
 	a.Mode = goModeToUnixMode(e.Mode())
-	a.Size = uint64(e.Size())
-	a.Mtime = uint64(e.ModTime().Unix())
+	a.Size = uint64(e.Size())            //nolint:gosec
+	a.Mtime = uint64(e.ModTime().Unix()) //nolint:gosec
 	a.Ctime = a.Mtime
 	a.Atime = a.Mtime
 	a.Nlink = 1
diff --git a/internal/gather/gather_bytes.go b/internal/gather/gather_bytes.go
index 178b5955..8fb34974 100644
--- a/internal/gather/gather_bytes.go
+++ b/internal/gather/gather_bytes.go
@@ -18,6 +18,8 @@
 )
 
 // Bytes represents a sequence of bytes split into slices.
+//
+//nolint:recvcheck
 type Bytes struct {
 	Slices [][]byte
 
diff --git a/internal/stat/stat_unix.go b/internal/stat/stat_unix.go
index 49a91096..8f6ea65f 100644
--- a/internal/stat/stat_unix.go
+++ b/internal/stat/stat_unix.go
@@ -27,6 +27,7 @@ func GetFileAllocSize(fname string) (uint64, error) {
 		return 0, err //nolint:wrapcheck
 	}
 
+	//nolint:gosec
 	return uint64(st.Blocks) * diskBlockSize, nil
 }
 
diff --git a/internal/volumesizeinfo/volume_size_info_common.go b/internal/volumesizeinfo/volume_size_info_common.go
index fa40c144..e0d17eca 100644
--- a/internal/volumesizeinfo/volume_size_info_common.go
+++ b/internal/volumesizeinfo/volume_size_info_common.go
@@ -15,8 +15,8 @@ func getPlatformVolumeSizeInfo(volumeMountPoint string) (VolumeSizeInfo, error)
 	}
 
 	return VolumeSizeInfo{
-		TotalSize: stats.Blocks * uint64(stats.Bsize),                 //nolint:unconvert,nolintlint
-		UsedSize:  (stats.Blocks - stats.Bfree) * uint64(stats.Bsize), //nolint:unconvert,nolintlint
+		TotalSize: stats.Blocks * uint64(stats.Bsize),                 //nolint:gosec,unconvert,nolintlint
+		UsedSize:  (stats.Blocks - stats.Bfree) * uint64(stats.Bsize), //nolint:gosec,unconvert,nolintlint
 		// Conversion to uint64 is needed for some arch/distrib combination.
 		FilesCount: stats.Files - uint64(stats.Ffree), //nolint:unconvert,nolintlint
 	}, nil
diff --git a/notification/sender/sender_config.go b/notification/sender/sender_config.go
index 9855c41d..abb45a3d 100644
--- a/notification/sender/sender_config.go
+++ b/notification/sender/sender_config.go
@@ -10,6 +10,8 @@
 type Method string
 
 // MethodConfig represents JSON-serializable configuration of a notification method and parameters.
+//
+//nolint:recvcheck
 type MethodConfig struct {
 	Type   Method
 	Config any
diff --git a/repo/blob/config.go b/repo/blob/config.go
index 215fe128..4ec6da65 100644
--- a/repo/blob/config.go
+++ b/repo/blob/config.go
@@ -7,6 +7,8 @@
 )
 
 // ConnectionInfo represents JSON-serializable configuration of a blob storage.
+//
+//nolint:recvcheck
 type ConnectionInfo struct {
 	Type   string
 	Config interface{}
diff --git a/repo/blob/filesystem/filesystem_storage_capacity_unix.go b/repo/blob/filesystem/filesystem_storage_capacity_unix.go
index 7529db44..d3057c34 100644
--- a/repo/blob/filesystem/filesystem_storage_capacity_unix.go
+++ b/repo/blob/filesystem/filesystem_storage_capacity_unix.go
@@ -21,8 +21,8 @@ func (fs *fsStorage) GetCapacity(ctx context.Context) (blob.Capacity, error) {
 		}
 
 		return blob.Capacity{
-			SizeB: uint64(stat.Blocks) * uint64(stat.Bsize), //nolint:unconvert
-			FreeB: uint64(stat.Bavail) * uint64(stat.Bsize), //nolint:unconvert
+			SizeB: uint64(stat.Blocks) * uint64(stat.Bsize), //nolint:gosec,unconvert,nolintlint
+			FreeB: uint64(stat.Bavail) * uint64(stat.Bsize), //nolint:gosec,unconvert,nolintlint
 		}, nil
 	}, fs.Impl.(*fsImpl).isRetriable) //nolint:forcetypeassert
 }
diff --git a/repo/blob/gdrive/gdrive_storage.go b/repo/blob/gdrive/gdrive_storage.go
index f4aa0235..d37881a7 100644
--- a/repo/blob/gdrive/gdrive_storage.go
+++ b/repo/blob/gdrive/gdrive_storage.go
@@ -68,8 +68,8 @@ func (gdrive *gdriveStorage) GetCapacity(ctx context.Context) (blob.Capacity, er
 	}
 
 	return blob.Capacity{
-		SizeB: uint64(q.Limit),
-		FreeB: uint64(q.Limit) - uint64(q.Usage),
+		SizeB: uint64(q.Limit),                   //nolint:gosec
+		FreeB: uint64(q.Limit) - uint64(q.Usage), //nolint:gosec
 	}, nil
 }
 
diff --git a/repo/content/committed_read_manager.go b/repo/content/committed_read_manager.go
index 1dc8399f..16a651e7 100644
--- a/repo/content/committed_read_manager.go
+++ b/repo/content/committed_read_manager.go
@@ -181,6 +181,7 @@ func (sm *SharedManager) attemptReadPackFileLocalIndex(ctx context.Context, pack
 
 	postamble.localIndexOffset -= uint32(offset) //nolint:gosec
 
+	//nolint:gosec
 	if uint64(postamble.localIndexOffset+postamble.localIndexLength) > uint64(payload.Length()) {
 		// invalid offset/length
 		return errors.Errorf("unable to find valid local index in file %v - invalid offset/length", packFile)
diff --git a/repo/content/index/id.go b/repo/content/index/id.go
index 062de0ee..d058af83 100644
--- a/repo/content/index/id.go
+++ b/repo/content/index/id.go
@@ -30,6 +30,8 @@ func (p IDPrefix) ValidateSingle() error {
 }
 
 // ID is an identifier of content in content-addressable storage.
+//
+//nolint:recvcheck
 type ID struct {
 	data [hashing.MaxHashSize]byte
 
diff --git a/repo/content/index/index_builder.go b/repo/content/index/index_builder.go
index 3647b38a..e6216d8d 100644
--- a/repo/content/index/index_builder.go
+++ b/repo/content/index/index_builder.go
@@ -111,7 +111,7 @@ func (b Builder) sortedContents() []*Info {
 	// Phase 3 - merge results from all buckets.
 	result := make([]*Info, 0, len(b))
 
-	for i := range len(buckets) {
+	for i := range len(buckets) { //nolint:intrange
 		result = append(result, buckets[i]...)
 	}
 
diff --git a/repo/content/index/index_v1.go b/repo/content/index/index_v1.go
index 002657c4..1f117062 100644
--- a/repo/content/index/index_v1.go
+++ b/repo/content/index/index_v1.go
@@ -366,7 +366,7 @@ func (b *indexBuilderV1) formatEntry(entry []byte, it *Info) error {
 	entryPackFileOffset := entry[8:12]
 	entryPackedOffset := entry[12:16]
 	entryPackedLength := entry[16:20]
-	timestampAndFlags := uint64(it.TimestampSeconds) << 16 //nolint:mnd
+	timestampAndFlags := uint64(it.TimestampSeconds) << 16 //nolint:mnd,gosec
 
 	packBlobID := it.PackBlobID
 	if len(packBlobID) == 0 {
diff --git a/repo/content/index/info.go b/repo/content/index/info.go
index 430af62e..53f041ed 100644
--- a/repo/content/index/info.go
+++ b/repo/content/index/info.go
@@ -8,6 +8,8 @@
 )
 
 // Info is an implementation of Info based on a structure.
+//
+//nolint:recvcheck
 type Info struct {
 	PackBlobID          blob.ID              `json:"packFile,omitempty"`
 	TimestampSeconds    int64                `json:"time"`
diff --git a/repo/content/index/merged.go b/repo/content/index/merged.go
index 603c90e4..ddce12b5 100644
--- a/repo/content/index/merged.go
+++ b/repo/content/index/merged.go
@@ -80,6 +80,7 @@ type nextInfo struct {
 	ch <-chan Info
 }
 
+//nolint:recvcheck
 type nextInfoHeap []*nextInfo
 
 func (h nextInfoHeap) Len() int { return len(h) }
diff --git a/repo/object/objectid.go b/repo/object/objectid.go
index c306c7f2..db8f53aa 100644
--- a/repo/object/objectid.go
+++ b/repo/object/objectid.go
@@ -15,6 +15,8 @@
 //  1. In a single content block, this is the most common case for small objects.
 //  2. In a series of content blocks with an indirect block pointing at them (multiple indirections are allowed).
 //     This is used for larger files. Object IDs using indirect blocks start with "I"
+//
+//nolint:recvcheck
 type ID struct {
 	cid         content.ID
 	indirection byte
diff --git a/repo/splitter/splitter_rabinkarp64.go b/repo/splitter/splitter_rabinkarp64.go
index 7a9cb6ba..31899df5 100644
--- a/repo/splitter/splitter_rabinkarp64.go
+++ b/repo/splitter/splitter_rabinkarp64.go
@@ -83,7 +83,7 @@ func (rs *rabinKarp64Splitter) MaxSegmentSize() int {
 }
 
 func newRabinKarp64SplitterFactory(avgSize int) Factory {
-	mask := uint64(avgSize - 1)
+	mask := uint64(avgSize - 1)              //nolint:gosec
 	minSize, maxSize := avgSize/2, avgSize*2 //nolint:mnd
 
 	return func() Splitter {
diff --git a/snapshot/manifest.go b/snapshot/manifest.go
index 5a8d44ba..5165894b 100644
--- a/snapshot/manifest.go
+++ b/snapshot/manifest.go
@@ -84,6 +84,8 @@ func (m *Manifest) UpdatePins(add, remove []string) bool {
 )
 
 // Permissions encapsulates UNIX permissions for a filesystem entry.
+//
+//nolint:recvcheck
 type Permissions int
 
 // MarshalJSON emits permissions as octal string.
diff --git a/snapshot/policy/os_snapshot_policy.go b/snapshot/policy/os_snapshot_policy.go
index f1db2258..6c80f556 100644
--- a/snapshot/policy/os_snapshot_policy.go
+++ b/snapshot/policy/os_snapshot_policy.go
@@ -36,6 +36,8 @@ func (p *VolumeShadowCopyPolicy) Merge(src VolumeShadowCopyPolicy, def *VolumeSh
 
 // OSSnapshotMode specifies whether OS-level snapshots are used for file systems
 // that support them.
+//
+//nolint:recvcheck
 type OSSnapshotMode byte
 
 // OS-level snapshot modes.
diff --git a/snapshot/policy/scheduling_policy.go b/snapshot/policy/scheduling_policy.go
index d91d5a2a..276bbd85 100644
--- a/snapshot/policy/scheduling_policy.go
+++ b/snapshot/policy/scheduling_policy.go
@@ -17,6 +17,8 @@
 )
 
 // TimeOfDay represents the time of day (hh:mm) using 24-hour time format.
+//
+//nolint:recvcheck
 type TimeOfDay struct {
 	Hour   int `json:"hour"`
 	Minute int `json:"min"`
diff --git a/tools/gettool/checksums.txt b/tools/gettool/checksums.txt
index ae411cb3..d8ee53d1 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.60.3/golangci-lint-1.60.3-darwin-amd64.tar.gz: faf60366f99bb4010b634a030c45eaf57baae6c0b7e10be151139871e3fef40e
-https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-darwin-arm64.tar.gz: deb0fbd0b99992d97808614db1214f57d5bdc12b907581e2ef10d3a392aca11f
-https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-amd64.tar.gz: 4037af8122871f401ed874852a471e54f147ff8ce80f5a304e020503bdb806ef
-https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-arm64.tar.gz: 74782943b2d2edae1208be3701e0cafe62817ba90b9b4cc5ca52bdef26df12f9
-https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-armv6.tar.gz: 9478a9cee4ea48c3025516472624f34f2e3a3406d3ec6642c8cef3cd8359aea9
-https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-windows-amd64.zip: ebf030e0c25b99d1b5f301ec5f1ae0005c0d4f92d6ee79474ef170d69f390fef
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-darwin-amd64.tar.gz: 0ed6f1a216ddb62e293858196799608d63894bd2ec178114484363ca45cde84b
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-darwin-arm64.tar.gz: dde51958f0f24d442062b5709b6912d91e235115dfe5887e80b3e5602c9cc09b
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-linux-amd64.tar.gz: 53695531eeb824b6883c703335cef6f07882f8ba6fedc00ed43853ea07fa1fbd
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-linux-arm64.tar.gz: e1e47209d7bdd288fd8cfe88548b477df2f7eca81b0e9ec1f9d45604f79185eb
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-linux-armv6.tar.gz: 0a6565ed98da60b470f5652eb1bf434ae84f39ab0632749398176e1a9c477798
+https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-windows-amd64.zip: 34e980afe44655c395aa65f96953fc4b6a2e58206f1a7370ab88407b187184c8
 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 e29ed760..ce2fee16 100644
--- a/tools/tools.mk
+++ b/tools/tools.mk
@@ -102,7 +102,7 @@ retry:=
 endif
 
 # tool versions
-GOLANGCI_LINT_VERSION=1.60.3
+GOLANGCI_LINT_VERSION=1.62.0
 CHECKLOCKS_VERSION=e8c1fff214d0ecf02cfe5aa9c62d11174130c339
 NODE_VERSION=20.15.1
 HUGO_VERSION=0.113.0


Test patch:
diff --git a/fs/utc_timestamp_test.go b/fs/utc_timestamp_test.go
index 9e54a179..0d69258d 100644
--- a/fs/utc_timestamp_test.go
+++ b/fs/utc_timestamp_test.go
@@ -25,7 +25,7 @@ func TestUTCTimestamp(t *testing.T) {
 
 	v, err := json.Marshal(x)
 	require.NoError(t, err)
-	require.Equal(t, "{\"myts\":\"2022-01-02T03:04:05.000000006Z\"}", string(v))
+	require.JSONEq(t, "{\"myts\":\"2022-01-02T03:04:05.000000006Z\"}", string(v))
 
 	require.NoError(t, json.Unmarshal(v, &y))
 	require.Equal(t, x, y)
diff --git a/internal/metrics/metrics_aggregation_test.go b/internal/metrics/metrics_aggregation_test.go
index 4bb0995e..d5226e9b 100644
--- a/internal/metrics/metrics_aggregation_test.go
+++ b/internal/metrics/metrics_aggregation_test.go
@@ -87,11 +87,11 @@ func TestAggregation(t *testing.T) {
 		"counter4": 777,
 	}, res.Counters)
 
-	require.Equal(t,
+	require.JSONEq(t,
 		`{"dist1":{"min":50,"max":210,"sum":560,"count":4,"buckets":[2,2,0,0]}}`,
 		toJSON(res.SizeDistributions))
 
-	require.Equal(t,
+	require.JSONEq(t,
 		`{"dur1":{"min":50000000000,"max":210000000000,"sum":560000000000,"count":4,"buckets":[2,2,0,0]}}`,
 		toJSON(res.DurationDistributions))
 }
diff --git a/repo/blob/storage_test.go b/repo/blob/storage_test.go
index 60e9ddcd..39beaf7b 100644
--- a/repo/blob/storage_test.go
+++ b/repo/blob/storage_test.go
@@ -183,7 +183,7 @@ func TestMetataJSONString(t *testing.T) {
 		Timestamp: time.Date(2000, 1, 2, 3, 4, 5, 6, time.UTC),
 	}
 
-	require.Equal(t, `{"id":"foo","length":12345,"timestamp":"2000-01-02T03:04:05.000000006Z"}`, bm.String())
+	require.JSONEq(t, `{"id":"foo","length":12345,"timestamp":"2000-01-02T03:04:05.000000006Z"}`, bm.String())
 }
 
 func TestPutBlobAndGetMetadata(t *testing.T) {
diff --git a/repo/content/content_manager_test.go b/repo/content/content_manager_test.go
index 009df619..3f4f785c 100644
--- a/repo/content/content_manager_test.go
+++ b/repo/content/content_manager_test.go
@@ -2014,7 +2014,7 @@ func (s *contentManagerSuite) verifyReadsOwnWrites(t *testing.T, st blob.Storage
 	bm := s.newTestContentManagerWithTweaks(t, st, tweaks)
 
 	ids := make([]ID, 100)
-	for i := range len(ids) {
+	for i := range len(ids) { //nolint:intrange
 		ids[i] = writeContentAndVerify(ctx, t, bm, seededRandomData(i, maxPackCapacity/2))
 
 		for j := range i {
@@ -2035,7 +2035,7 @@ func (s *contentManagerSuite) verifyReadsOwnWrites(t *testing.T, st blob.Storage
 	require.NoError(t, bm.CloseShared(ctx))
 	bm = s.newTestContentManagerWithTweaks(t, st, tweaks)
 
-	for i := range len(ids) {
+	for i := range len(ids) { //nolint:intrange
 		verifyContent(ctx, t, bm, ids[i], seededRandomData(i, maxPackCapacity/2))
 	}
 }
@@ -2378,7 +2378,7 @@ func (s *contentManagerSuite) TestContentIndexPermissiveReadsWithFault(t *testin
 	bm := s.newTestContentManagerWithTweaks(t, st, tweaks)
 
 	ids := make([]ID, 100)
-	for i := range len(ids) {
+	for i := range len(ids) { //nolint:intrange
 		ids[i] = writeContentAndVerify(ctx, t, bm, seededRandomData(i, maxPackCapacity/2))
 
 		for j := range i {
@@ -2409,7 +2409,7 @@ func (s *contentManagerSuite) TestContentIndexPermissiveReadsWithFault(t *testin
 
 	bm = s.newTestContentManagerWithTweaks(t, st, tweaks)
 
-	for i := range len(ids) {
+	for i := range len(ids) { //nolint:intrange
 		verifyContent(ctx, t, bm, ids[i], seededRandomData(i, maxPackCapacity/2))
 	}
 }
diff --git a/repo/manifest/manifest_manager_test.go b/repo/manifest/manifest_manager_test.go
index c60fa24c..b866448c 100644
--- a/repo/manifest/manifest_manager_test.go
+++ b/repo/manifest/manifest_manager_test.go
@@ -184,7 +184,7 @@ func TestManifestInitCorruptedBlock(t *testing.T) {
 	for blobID, v := range data {
 		for _, prefix := range content.PackBlobIDPrefixes {
 			if strings.HasPrefix(string(blobID), string(prefix)) {
-				for i := range len(v) {
+				for i := range len(v) { // nolint:intrange
 					v[i] ^= 1
 				}
 			}
diff --git a/tests/end_to_end_test/snapshot_create_test.go b/tests/end_to_end_test/snapshot_create_test.go
index 48aeda67..16a13b3d 100644
--- a/tests/end_to_end_test/snapshot_create_test.go
+++ b/tests/end_to_end_test/snapshot_create_test.go
@@ -5,7 +5,6 @@
 	"path"
 	"path/filepath"
 	"reflect"
-	"regexp"
 	"runtime"
 	"sort"
 	"strings"
@@ -777,7 +776,7 @@ func TestSnapshotCreateAllSnapshotPath(t *testing.T) {
 	require.Equal(t, "foo", si[2].Host)
 
 	if runtime.GOOS == "windows" {
-		require.Regexp(t, regexp.MustCompile(`[A-Z]:\\foo\\bar`), si[2].Path)
+		require.Regexp(t, `[A-Z]:\\foo\\bar`, si[2].Path)
 	} else {
 		require.Equal(t, "/foo/bar", si[2].Path)
 	}