On Fri, 2024-05-10 at 04:24 -0700, Sebastian Bogan wrote:
> Hello Everyone,
>
> I was wondering, what was / is the reason for exposing errors as
> public vars - rather than constants? Doesn't that impose some risk?
>
> For example:
>
> fs.ErrNotExist = errors.New("foo")
> _, err =
Hello Everyone,
I was wondering, what was / is the reason for exposing errors as public
vars - rather than constants? Doesn't that impose some risk?
For example:
fs.ErrNotExist = errors.New("foo")
_, err = os.ReadFile("./invalid")
if !errors.Is(err, fs.ErrNotExist) {
fmt.Println("is