Address a lint error

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
Yusuke Kuoka 2022-10-10 15:14:55 +00:00 committed by yxxhero
parent 85bfe64b90
commit ef115ba653
5 changed files with 10 additions and 4 deletions

View File

@ -165,7 +165,7 @@ func TestApply_hooks(t *testing.T) {
t.Errorf("unexpected log:\nDIFF\n%s\nEOD", diff)
}
} else {
assertEqualsToSnapshot(t, "log", bs.String())
assertLogEqualsToSnapshot(t, bs.String())
}
}

View File

@ -166,7 +166,7 @@ func TestApply_3(t *testing.T) {
t.Errorf("unexpected log:\nDIFF\n%s\nEOD", diff)
}
} else {
assertEqualsToSnapshot(t, "log", bs.String())
assertLogEqualsToSnapshot(t, bs.String())
}
}

View File

@ -166,7 +166,7 @@ func TestApply_2(t *testing.T) {
t.Errorf("unexpected log:\nDIFF\n%s\nEOD", diff)
}
} else {
assertEqualsToSnapshot(t, "log", bs.String())
assertLogEqualsToSnapshot(t, bs.String())
}
}

View File

@ -4353,7 +4353,7 @@ changing working directory back to "/path/to"
t.Errorf("unexpected log for data defined %s:\nDIFF\n%s\nEOD", tc.loc, diff)
}
} else {
assertEqualsToSnapshot(t, "log", bs.String())
assertLogEqualsToSnapshot(t, bs.String())
}
})
}

View File

@ -10,6 +10,12 @@ import (
"github.com/google/go-cmp/cmp"
)
func assertLogEqualsToSnapshot(t *testing.T, data string) {
t.Helper()
assertEqualsToSnapshot(t, "log", data)
}
func assertEqualsToSnapshot(t *testing.T, name string, data string) {
type thisPkgLocator struct{}