Closed nphilbrook closed 1 year ago
Hi @nphilbrook, thanks for this contribution. I thought it was obvious, but it's better to be explicit about this, good catch!
Hi @nphilbrook, thanks for this contribution. I thought it was obvious, but it's better to be explicit about this, good catch!
You're welcome! You'd think it would be obvious...but you know how engineers love to copy and paste without thinking critically :D
Hopefully the comment will help someone in the future.
While using this library, I noticed 2 spots in my employer's code where this
defer hook.Flush()
code was copied verbatim into a non-main()
method, completely negating the effect, since the Flush method would only be called at the end of method being used to set up the hook, NOT before the end of program's execution.This PR attempts to clarify without being overly verbose, open to feedback.
Thanks for providing this library!