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

use defer instead of os.Exit(m.Run()) #493

Merged
merged 2 commits into from
Jun 13, 2024
Merged

use defer instead of os.Exit(m.Run()) #493

merged 2 commits into from
Jun 13, 2024

Conversation

pmenglund
Copy link
Contributor

as of go1.15 testing.M returns the return code of m.Run(), so it is possible to use defer

Related Issue or Design Document

golang/go#34129

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

n/a

@CLAassistant
Copy link

CLAassistant commented Feb 6, 2024

CLA assistant check
All committers have signed the CLA.

@pmenglund
Copy link
Contributor Author

this fails on something unrelated to the PR:

Error: ../../../go/pkg/mod/github.com/docker/[email protected]+incompatible/cli/compose/template/template.go:242:14: undefined: strings.Cut

do you want me to fix the issue in this PR or a separate one?

@alnr
Copy link
Contributor

alnr commented Jun 13, 2024

This is a good improvement. Would you mind rebasing to get rid of the updated Copyright headers?

@pmenglund
Copy link
Contributor Author

This is a good improvement. Would you mind rebasing to get rid of the updated Copyright headers?

Seems like you did this already. Let me know if there is anything else I should do...

docker/change.go Outdated
@@ -1,4 +1,4 @@
// Copyright © 2023 Ory Corp
// Copyright © 2024 Ory Corp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, can you revert all of these changes?

as of go1.15 `testing.M` returns the return code of `m.Run()`, so it is
possible to use `defer`
golang/go#34129
Copy link
Contributor

@alnr alnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alnr alnr merged commit 5bc2dc2 into ory:v3 Jun 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants