Merge pull request #129380 from jdtuhui/testifylint/len@component-base

fix: enable len rule from testifylint in module component-base
This commit is contained in:
Kubernetes Prow Robot 2024-12-27 10:20:12 +01:00 committed by GitHub
commit 7bfdda4696
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -98,7 +98,7 @@ func TestZapLoggerInfo(t *testing.T) {
logStrLines := strings.Split(logStr, "\n")
dataFormatLines := strings.Split(data.format, "\n")
if !assert.Equal(t, len(logStrLines), len(dataFormatLines)) {
if !assert.Len(t, logStrLines, len(dataFormatLines)) {
t.Errorf("Info has wrong format: no. of lines in log is incorrect \n expect:%d\n got:%d", len(dataFormatLines), len(logStrLines))
}