Functions in github.com/stretchr/testify of the form,
func True(t TestingT, value bool, msgAndArgs ...interface{}) {
expect that when len(msgAndArgs) > 1, the first vararg is a format string [1]. Note the cast in [1] which results in panic unless the first vararg is of type string.
Violations to this contract have been detected in existing tests, e.g., [2]. We should consider adding a linter.
Functions in
github.com/stretchr/testify
of the form,expect that when
len(msgAndArgs) > 1
, the first vararg is a formatstring
[1]. Note the cast in [1] which results inpanic
unless the first vararg is of typestring
.Violations to this contract have been detected in existing tests, e.g., [2]. We should consider adding a linter.
[1] https://github.com/stretchr/testify/blob/c5fc9d6b6b21ea89be8480c0dc35e2977ab988f6/assert/assertions.go#L233 [2] https://github.com/cockroachdb/cockroach/pull/95842
Jira issue: CRDB-26761