Fix some warnings

golangci-lint linter: unparam

This primarily fixes TestProxy to test the correct image

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-02-13 18:55:37 +01:00
parent 371604ba27
commit 4beb3f0af9
8 changed files with 21 additions and 27 deletions

View File

@@ -188,7 +188,7 @@ func fileFromFixture(t *testing.T, inputPath string, edits map[string]string) st
// runDecompressDirs runs decompress-dirs.sh using exec.Command().CombinedOutput, verifies that the exit status is 0,
// and optionally that the output matches a multi-line regexp if it is nonempty; or terminates c on failure
func runDecompressDirs(t *testing.T, regexp string, args ...string) {
func runDecompressDirs(t *testing.T, args ...string) {
t.Logf("Running %s %s", decompressDirsBinary, strings.Join(args, " "))
for i, dir := range args {
m, err := os.ReadFile(filepath.Join(dir, "manifest.json"))
@@ -205,9 +205,6 @@ func runDecompressDirs(t *testing.T, regexp string, args ...string) {
require.NoError(t, err)
t.Logf("manifest %d after: %s", i+1, string(m))
}
if regexp != "" {
assert.Regexp(t, "(?s)"+regexp, string(out)) // (?s) : '.' will also match newlines
}
}
// Verify manifest in a dir: image at dir is expectedMIMEType.