Update errors_test.go
без этих тестов можно не смотреть на типы assert и require во время анализа, а можно просто смотреть на количество аргументов при вызове
This commit is contained in:
parent
7a2e32a0eb
commit
ad5f19400a
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,11 @@ func TestFunctions(t *testing.T) {
|
||||||
assert.Nilf(t, err, "%s", "a") // want `use assert.NoErrorf instead of comparing error to nil`
|
assert.Nilf(t, err, "%s", "a") // want `use assert.NoErrorf instead of comparing error to nil`
|
||||||
assert.NotNilf(t, err, "%s", "a") // want `use assert.Errorf instead of comparing error to nil`
|
assert.NotNilf(t, err, "%s", "a") // want `use assert.Errorf instead of comparing error to nil`
|
||||||
|
|
||||||
|
require.Nilf(t, err, "a") // want `use require.NoErrorf instead of comparing error to nil`
|
||||||
|
require.NotNilf(t, err, "a") // want `use require.Errorf instead of comparing error to nil`
|
||||||
|
assert.Nilf(t, err, "a") // want `use assert.NoErrorf instead of comparing error to nil`
|
||||||
|
assert.NotNilf(t, err, "a") // want `use assert.Errorf instead of comparing error to nil`
|
||||||
|
|
||||||
p := new(int)
|
p := new(int)
|
||||||
|
|
||||||
require.Nil(t, p)
|
require.Nil(t, p)
|
||||||
|
|
Loading…
Reference in a new issue