Description
Hello, team!
I was surprised, but testify allows to set non-string in msgAndArgs... if this is the single argument:
|
if len(msgAndArgs) == 1 { |
|
msg := msgAndArgs[0] |
|
if msgAsStr, ok := msg.(string); ok { |
|
return msgAsStr |
|
} |
|
return fmt.Sprintf("%+v", msg) |
|
} |
So I can do
assert.Equal(a, b, new(time.Time))
But cannot
assert.Equal(a, b, new(time.Time), 1, 2, 3) // Panics.
Proposed solution
Remove support of non-string single arg (as rare and strange? case) and allows only msg string + args ...any.
Use case
f-assertions future (#1089 (comment)).
Description
Hello, team!
I was surprised, but
testifyallows to set non-string inmsgAndArgs...if this is the single argument:testify/assert/assertions.go
Lines 290 to 296 in 89cbdd9
So I can do
But cannot
Proposed solution
Remove support of non-string single arg (as rare and strange? case) and allows only
msg string+args ...any.Use case
f-assertions future (#1089 (comment)).