Skip to content

Fix staticcheck warnings in run.go#564

Merged
JamieMagee merged 2 commits intomainfrom
jamiemagee/fix-staticcheck-warnings
Feb 9, 2026
Merged

Fix staticcheck warnings in run.go#564
JamieMagee merged 2 commits intomainfrom
jamiemagee/fix-staticcheck-warnings

Conversation

@JamieMagee
Copy link
Member

@JamieMagee JamieMagee commented Feb 9, 2026

golangci-lint reports four staticcheck diagnostics in internal/infra/run.go. This PR fixes all of them.

  • SA1019 — deprecated TarWithOptions
    • github.com/docker/docker/pkg/archive.TarWithOptions is deprecated in favour of github.com/moby/go-archive (already an indirect dependency). Swapped the import; the function signature is identical.
  • SA1019 — deprecated ImageInspectWithRaw
    • client.ImageInspectWithRaw is deprecated in favour of client.ImageInspect, which drops the unused raw []byte return value. Both call sites in pullImage are updated.
  • S1009 — redundant nil check before len()
    • len() on a nil slice returns 0, so the leading inspect.RepoDigests == nil guard is unnecessary. Removed it.

@JamieMagee JamieMagee requested review from a team as code owners February 9, 2026 22:44
Replace deprecated Docker SDK calls with their current equivalents:

- Use github.com/moby/go-archive instead of
  github.com/docker/docker/pkg/archive for TarWithOptions (SA1019)
- Use client.ImageInspect instead of the deprecated
  ImageInspectWithRaw (SA1019)
- Drop redundant nil check before len() on RepoDigests slice (S1009)
@JamieMagee JamieMagee force-pushed the jamiemagee/fix-staticcheck-warnings branch from eaa33cc to 5e01e77 Compare February 9, 2026 22:46
truggeri
truggeri previously approved these changes Feb 9, 2026
@JamieMagee JamieMagee enabled auto-merge February 9, 2026 22:49
@JamieMagee JamieMagee added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit 22456f0 Feb 9, 2026
89 checks passed
@JamieMagee JamieMagee deleted the jamiemagee/fix-staticcheck-warnings branch February 9, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants