Skip to content

Mutagen using less reliable err == <sentinal> rather than errors.Is(err,<sentinal>) #504

@mikeschinkel

Description

@mikeschinkel

While trying to fix Mutagen to allow me to use it for my use-case, my IDE and linter kept complaining about err == <sentinal> when AFAIK errors.Is(err,<sentinal>) [has been recommended since it was added in Go 1.13.

In order to shut up my linter I went ahead and found all the cases in this repo where err == <sentinal> and changed them to be errors.Is(err,<sentinal>).

I also found one of linter concern where it was flagging shortLastBlock might be nil because of an indirect check via a haveShortLastBlock variable. My PR replaces that variable with a simple shortLastBlock!=nil since there was only one case and that stopped the linter from flagging it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions