tar-split icon indicating copy to clipboard operation
tar-split copied to clipboard

Using defer

Open aiburegit opened this issue 1 year ago • 1 comments

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?

aiburegit avatar Nov 19 '24 14:11 aiburegit

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?

vbatts avatar Nov 22 '24 16:11 vbatts