From 33bc4b839763ce6cdfef91a43b8151552eb6abe6 Mon Sep 17 00:00:00 2001 From: anchore-oss-update-bot Date: Mon, 20 Apr 2026 10:03:15 -0400 Subject: [PATCH] chore(deps): update Go version (#4798) Signed-off-by: anchore-oss-update-bot Co-authored-by: anchore-oss-update-bot --- syft/pkg/cataloger/golang/upx.go | 5 +---- syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go | 4 ++-- syft/pkg/package.go | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/syft/pkg/cataloger/golang/upx.go b/syft/pkg/cataloger/golang/upx.go index e3b5d882f..334e5d59d 100644 --- a/syft/pkg/cataloger/golang/upx.go +++ b/syft/pkg/cataloger/golang/upx.go @@ -499,10 +499,7 @@ func decompressLZMA(compressedData []byte, uncompressedSize uint32) ([]byte, err // it may be that the dictionary size was not considered properly in this code. const minDictSize = 64 * 1024 // 64KB minimum const maxDictSize = 128 * 1024 * 1024 // 128MB maximum - dictSize := max(nextPowerOf2(uncompressedSize), minDictSize) - if dictSize > maxDictSize { - dictSize = maxDictSize - } + dictSize := min(max(nextPowerOf2(uncompressedSize), minDictSize), maxDictSize) // construct standard 13-byte LZMA header header := make([]byte, 13) diff --git a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go index b5a2f8173..b3d2a433c 100644 --- a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go +++ b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go @@ -548,7 +548,7 @@ snapshots: `) // run multiple times to catch nondeterminism - for i := 0; i < 10; i++ { + for range 10 { parser := &pnpmV9LockYaml{} pkgs, err := parser.Parse(9.0, lockfileV9) require.NoError(t, err) @@ -570,7 +570,7 @@ packages: resolution: {integrity: sha512-AAA} `) - for i := 0; i < 10; i++ { + for range 10 { parser := &pnpmV6LockYaml{} pkgs, err := parser.Parse(6.0, lockfileV6) require.NoError(t, err) diff --git a/syft/pkg/package.go b/syft/pkg/package.go index 28452c070..d649db292 100644 --- a/syft/pkg/package.go +++ b/syft/pkg/package.go @@ -112,7 +112,7 @@ func Less(i, j Package) bool { jLocations := j.Locations.ToSlice() if i.Type == j.Type { maxLen := max(len(jLocations), len(iLocations)) - for l := 0; l < maxLen; l++ { + for l := range maxLen { if len(iLocations) < l+1 || len(jLocations) < l+1 { if len(iLocations) == len(jLocations) { break