dockertest icon indicating copy to clipboard operation
dockertest copied to clipboard

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

Open pmenglund opened this issue 1 year ago • 2 comments

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

https://github.com/golang/go/issues/34129

Checklist

  • [x] 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.
  • [x] I have read the security policy.
  • [x] 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.
  • [x] I have added tests that prove my fix is effective or that my feature works.
  • [x] I have added the necessary documentation within the code base (if appropriate).

Further comments

n/a

pmenglund avatar Feb 06 '24 21:02 pmenglund

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 06 '24 21:02 CLAassistant

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?

pmenglund avatar Feb 07 '24 03:02 pmenglund

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

alnr avatar Jun 13 '24 11:06 alnr

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...

pmenglund avatar Jun 13 '24 14:06 pmenglund