Skip to content

v0.1.0: Support 'handle error once' idiom

Compare
Choose a tag to compare
@tenntenn tenntenn released this 19 Oct 00:30
· 6 commits to master since this release
e054c31

#4 by @PeterIvanov (Thanks!! 🎉 )

  • if err is used as an argument in a function call, it is not considered a mistake to return nil
  • such uses with .Error() and with non-err or vararg parameters are also supported
  • a line number is added to waning text, because in some cases the offending error assignment is not that easy to find
  • multiple possible assignments are supported - for example, if err is checked and then overwritten in a loop
  • after a negative err check, warning is not issued if there are other conditions in if statement
  • added support for multiple error return values