3 ms·
Go makes it really easy to linters (lexer and parser in standard library, simple AST, etc.), so there is a robust linger for that: https://github.com/kisielk/er
by aleksi 11y ago
Go makes it really easy to linters (lexer and parser in standard library, simple AST, etc.), so there is a robust linger for that: https://github.com/kisielk/errcheck https://github.com/kisielk/errcheck
- pcwalton 11y agoIt's just as easy in C to write that linter in the post-libclang world. (Except that it's not necessary, since all major open source compilers support the warn-unused-result attribute as a builtin, while Go requires an external tool.) Go's error model doesn't differ fundamentally from that of C. The built-in unused value error helps a lot by catching a sizable subset of cases, though; Go's designers made the right call there.