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

Using defer #75

Open
aiburegit opened this issue Nov 19, 2024 · 1 comment
Open

Using defer #75

aiburegit opened this issue Nov 19, 2024 · 1 comment

Comments

@aiburegit
Copy link

https://github.com/vbatts/tar-split/blame/cc780eeb0b3ffe3ff4b360a8a0bd18f54c5b32ce/tar/asm/disassemble.go#L152

Good afternoon!
Can we use defer when closing pW.Close() to minimize the chance of resource leakage?

@vbatts
Copy link
Owner

vbatts commented Nov 22, 2024

defer() is useful and nice. I avoided it due to the performance findings like https://lk4d4.darth.io/posts/defer/
Do you have findings that it is being leaked?

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

No branches or pull requests

2 participants