Skip to content

Commit 668c5f0

Browse files
RTECO-945 - Fix golangci-lint errors in apk_test.go and buildtools/cli.go
- errcheck: replace defer os.RemoveAll with clientTestUtils.RemoveAllAndAssert so the error return is not silently dropped (apk_test.go lines 658, 761) - ineffassign: reassigned args is never read after ExtractBoolFlagFromArgs; use _ to make the intent explicit (buildtools/cli.go line 2215) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 541f73c commit 668c5f0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apk_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ func TestApkFetch_Passthrough(t *testing.T) {
655655
if err != nil {
656656
t.Fatalf("failed to create temp dir: %v", err)
657657
}
658-
defer os.RemoveAll(tmpDir)
658+
defer clientTestUtils.RemoveAllAndAssert(t, tmpDir)
659659

660660
jfrogCli := coretests.NewJfrogCli(execMain, "jfrog", "")
661661
fetchErr := jfrogCli.Exec("apk", "fetch", "--output", tmpDir, "curl")
@@ -758,7 +758,7 @@ func TestApkUpload_LocalApkFile(t *testing.T) {
758758
if err != nil {
759759
t.Fatalf("failed to create temp dir: %v", err)
760760
}
761-
defer os.RemoveAll(tmpDir)
761+
defer clientTestUtils.RemoveAllAndAssert(t, tmpDir)
762762

763763
// Build a minimal .apk (tgz containing just a PKGINFO) via abuild-tar or tar.
764764
// If abuild-tar is not available, skip gracefully.

buildtools/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ func apkConfigSubCmd(args []string, serverDetails *coreConfig.ServerDetails, rep
22122212
if branch == "" {
22132213
branch = "main"
22142214
}
2215-
args, applyFlag, err := coreutils.ExtractBoolFlagFromArgs(args, "apply")
2215+
_, applyFlag, err := coreutils.ExtractBoolFlagFromArgs(args, "apply")
22162216
if err != nil {
22172217
return errorutils.CheckErrorf("failed to extract --apply: %w", err)
22182218
}

0 commit comments

Comments
 (0)