kaxap / switcherr

linter for switch error handling. WIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

switcherr

Work in progress.

A linter for switch-case error handling.

Typical use case:

a, err := someFunc()
switch {
case a == 0:
  return ErrNotFound
case err != nil:
  return err
}

In the code above err != nil is never reached due to default value of a being 0.

About

linter for switch error handling. WIP

License:MIT License


Languages

Language:Go 100.0%