6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 14:31:49 +00:00

Fix issues found by staticcheck linter

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-24 18:05:15 +02:00
parent 08f3264cd0
commit 8b8c814ced
2 changed files with 4 additions and 5 deletions

View File

@@ -4,7 +4,6 @@ package test
import ( import (
"fmt" "fmt"
"git-get/pkg/run" "git-get/pkg/run"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
@@ -16,7 +15,9 @@ import (
func TempDir(t *testing.T, parent string) string { func TempDir(t *testing.T, parent string) string {
t.Helper() t.Helper()
dir, err := ioutil.TempDir(parent, "git-get-repo-") // t.TempDir() is not enough in this case, we need to be able to create dirs inside the parent dir
//nolint:usetesting
dir, err := os.MkdirTemp(parent, "git-get-repo-")
checkFatal(t, err) checkFatal(t, err)
// Automatically remove temp dir when the test is over. // Automatically remove temp dir when the test is over.

View File

@@ -27,9 +27,7 @@ func Errors(repos []Printable) string {
errors := []string{} errors := []string{}
for _, repo := range repos { for _, repo := range repos {
for _, err := range repo.Errors() { errors = append(errors, repo.Errors()...)
errors = append(errors, err)
}
} }
if len(errors) == 0 { if len(errors) == 0 {