Go global variables
Let’s face it. Global variables are mostly bad and you should not use them. BUT they are cases where it’s better to use them. This post will explore these. Sentinel errors In Go, you don’t throw and catch errors. You wrap and return them, and check them with errors.Is(err, errSomething). You may wonder what errSomething is? It’s a sentinel error. The error check errors.Is(err, errSomething) will return true only if errSomething is the same error variable as err or as the one wrapped in err....