kinbiko / bugsnag

Well-documented, maintainable, idiomatic, opinionated, and *unofficial* rewrite of the Bugsnag Go notifier
MIT License
3 stars 0 forks source link

[feat] Implement Close() #14

Closed kinbiko closed 4 years ago

kinbiko commented 4 years ago

This method flushes the unsent reports and sessions upon being invoked. Note: This method does not conform to the io.Closer interface because it doesn't return an error. I'm not a fan of this function returning an error in the first place, so instead of propagating unnecessary defer func(){_ = n.Close()}() where the Close func never returns an error anyway just to adhere to the interface, I decided to not return anything in the first place.

Additional changes:

kinbiko commented 4 years ago

Need to update the docs on New to indicate that n.Close() should also be called when closing the app. Needs testing.