Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use Contains or ErrorContains with testify #2839

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Oct 18, 2024

What does this PR do?

It uses require.Contains(t,...) or require.ErrorContains(t, err,...) when possible
It also removes require.Error(t, err,...) as it is redundant with require.ErrorContains(t, err,...) behavior

Why is it important?

To simplify code and not omit to check that error happened befort checking it's message content.

Signed-off-by: Matthieu MOREL matthieu.morel35@gmail.com

@mmorel-35 mmorel-35 requested a review from a team as a code owner October 18, 2024 17:51
Copy link

netlify bot commented Oct 18, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 7bc8a60
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6712ab83f84c39000875aa3e
😎 Deploy Preview https://deploy-preview-2839--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mmorel-35
Copy link
Contributor Author

/cc @stevenh

@mmorel-35 mmorel-35 force-pushed the testifylint/contains branch from fb53979 to 3fe1467 Compare October 18, 2024 17:57
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35 mmorel-35 force-pushed the testifylint/contains branch from 3fe1467 to 7bc8a60 Compare October 18, 2024 18:40
@stevenh stevenh merged commit f1632b3 into testcontainers:main Oct 18, 2024
120 checks passed
@mmorel-35 mmorel-35 deleted the testifylint/contains branch October 19, 2024 04:30
@mdelapenya mdelapenya assigned mdelapenya and stevenh and unassigned mdelapenya Oct 19, 2024
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants