Update errors_test.go

без этих тестов можно не смотреть на типы assert и require во время анализа, а можно просто смотреть на количество аргументов при вызове
This commit is contained in:
Nikita Pilnenskiy 2023-05-02 21:51:59 +00:00 committed by Fedor Korotkiy
parent 7a2e32a0eb
commit ad5f19400a

View file

@ -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)