// RequireEqualError uses testify's require package to check if errors
// are equal or, if assert.AnError is expected, whether an error exists
// or not.
RequireEqualError uses testify's require package to check if errors
are equal or, if assert.AnError is expected, whether an error exists
or not.
// RequireEqualError uses testify ' s require package to check if errors // are equal or if assert . AnError is expected whether an error exists // or not .
func RequireEqualError(t *testing.T, exp, err error) {
	t.Helper()
	if exp != nil {
		if exp == assert.AnError { 
			require.Error(t, err)
			return
		}
		require.Equal(t, exp, err)
		return
	}
	require.NoError(t, err)
}
func RequireEqualError ( t * testing . T , exp , err error ) { t . Helper ( ) if exp != nil { if exp == assert . AnError { require . Error ( t , err ) return } require . Equal ( t , exp , err ) return } require . NoError ( t , err ) }
RequireEqualError uses testify's require package to check if errors
are equal or, if assert.AnError is expected, whether an error exists
or not.
RequireEqualError uses testify ' s require 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