// AssertEqualError uses testify's assert package to check if errors
// are equal or, if assert.AnError is expected, whether an error exists
// or not.
AssertEqualError uses testify's assert package to check if errors
are equal or, if assert.AnError is expected, whether an error exists
or not.
// AssertEqualError uses testify ' s assert package to check if errors // are equal or if assert . AnError is expected whether an error exists // or not .
func AssertEqualError(t *testing.T, exp, err error) {
	t.Helper()
	if exp != nil {
		if exp == assert.AnError { 
			assert.Error(t, err)
			return
		}
		assert.Equal(t, exp, err)
		return
	}
	assert.NoError(t, err)
}
func AssertEqualError ( t * testing . T , exp , err error ) { t . Helper ( ) if exp != nil { if exp == assert . AnError { assert . Error ( t , err ) return } assert . Equal ( t , exp , err ) return } assert . NoError ( t , err ) }
AssertEqualError uses testify's assert package to check if errors
are equal or, if assert.AnError is expected, whether an error exists
or not.
AssertEqualError uses testify ' s assert package to check if errors are equal or if assert . AnError is expected whether an error exists or not .
//nolint:goerr113 // direct check is needed