You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Panic().Err(err).Msg("Can't establish connection to the server!!!")
Here using a defer wg.Done() could simplify your code, but as your comment suggests you can't do that because of the panic.
Panicking is okay-is in the main, but you should definitely avoid it anywhere else.
There are different ways to return errors from even a goroutin, I'd suggest you to experiment with channels maybe or you could simply return an error value with a param too. (Pointers could be useful.)
The text was updated successfully, but these errors were encountered:
I definately need to think about how I approach breaking errors, as in a constant running Server app, self-healing is pretty much a must.
Many of my function completely disregard error returns, even if they DO return an error, it's simply not checked.
It's something I have to come back at some point to resolve.
go-locker/locker/agent.go
Line 79 in 88676e1
Here using a defer wg.Done() could simplify your code, but as your comment suggests you can't do that because of the panic.
Panicking is okay-is in the main, but you should definitely avoid it anywhere else.
There are different ways to return errors from even a goroutin, I'd suggest you to experiment with channels maybe or you could simply return an error value with a param too. (Pointers could be useful.)
The text was updated successfully, but these errors were encountered: