开发者

Can you show compiler warnings for error:nil?

开发者 https://www.devze.com 2023-03-09 22:21 出处:网络
Is there a compiler setting that can warn about these? Currently I\'m reviewing code and putting in #warning don\'t use error:nil whenever I see them.

Is there a compiler setting that can warn about these? Currently I'm reviewing code and putting in #warning don't use error:nil whenever I see them.

(I know it's sometimes appropriate to do, but maybe there is a better way to have the开发者_JAVA百科 compiler check sloppy error handling?)


No, since error:nil is completely legal and totally legit (as you even say), there is no way for the compiler to check it.

0

精彩评论

暂无评论...
验证码 换一张
取 消