kisielk/errcheck
View on GitHub ↗ ★ 2,532 Go
errcheck checks that you checked errors.
33 mentions on Hacker News by 27 people: 0 stories, 33 comments · first 2013-06-02 · latest 2025-06-04
20082026
-
I agree with item #1, but it can be mitigated somewhat with dev tools like errcheck: https://github.com/kisielk/errcheck?tab=readme-ov-file
comment by SkepticalWhale · 2025-06-04 · in (On | No) Syntactic Support for Error Handling -
That is a fair point and it's why I use errcheck[0]. [0]: https://github.com/kisielk/errcheck
comment by cube2222 · 2022-12-11 · in New in Go 1.20: wrapping multiple errors -
https://github.com/kisielk/errcheck Every Go project I've worked on has used this linter. I think it should be builtin, but it's very easy to incorporate.
comment by pipe_connector · 2022-11-23 · in Using Rust at a startup: A cautionary tale -
https://github.com/kisielk/errcheck , which is in most of the combined linter packages by default. We'll agree to disagree about unused imports; imports have can side-effects.
comment by morelisp · 2022-05-23 · in Proposal: Go 2: Lightweight anonymous function syntax -
…( https://go.dev/play/p/se6-zHHVezH ). There are static error checking tools you can use like https://github.com/kisielk/errcheck to work around this, but most people don't use them. I've run into a lack of Go error checking many times.…
comment by HL33tibCe7 · 2022-04-28 · in I want off Mr. Golang’s Wild Ride (2020) -
…be used instead. I respect Go's philosophy, but I feel like pragmatism must win in this case. [1]: https://github.com/kisielk/errcheck [2]: https://github.com/gordonklaus/ineffassign [3]: https://pkg.go.dev/builtin#error
comment by cytzol · 2021-12-16 · in Trying Out Generics in Go -
…of errcheck, which is more thorough and integrated into most Go linting tools like Go CI linter. https://github.com/kisielk/errcheck In any case, it’s trivial to detect via static analysis.
comment by jchw · 2020-07-24 · in Cold Showers: For when people get too hyped up about things -
there are linters that will help you with that. https://github.com/kisielk/errcheck https://golangci-lint.run/usage/linters/ has a solid set of options.
comment by jatone · 2020-06-17 · in The Next Step for Generics -
> Go does absolutely nothing to ensure you handle the error. Go has many community linters available, https://github.com/kisielk/errcheck is popular for checking unhandled errors. If you'd like a combo-pack, check out…
comment by shazow · 2020-02-28 · in I Want Off Mr. Golang's Wild Ride -
The errcheck linter is very popular for checking that you looked at every error return: https://github.com/kisielk/errcheck I use it in most of my open source projects.
comment by nickcw · 2019-11-16 · in The Value in Go’s Simplicity -
…actions, and money. Here are some additional tools that you might want to have in your module's tools.go: * github.com/kisielk/errcheck[1]: Find cases where you (accidentally?) ignore errors. * github.com/gordonklaus/ineffassign[2]: Find…
comment by ainar-g · 2019-11-11 · in Improving Go code: An introduction to the static analysis tool Staticcheck -
> I found it too easy to accidentally forget to check an error Use https://github.com/kisielk/errcheck for that. Or prefer https://staticcheck.io/ for a larger set of checks.
comment by agnivade · 2019-02-08 · in Moving from Go to PHP Again -
Specifically (if wanted standalone) https://github.com/kisielk/errcheck
comment by thegeekpirate · 2018-11-11 · in Nine years of Go -
…is much better to explicit ignore error: _ = index.Index(identifier, your_data) it will also pass https://github.com/kisielk/errcheck check eventually we can just panic error if err := index.Index(identifier, your_data); err != nil {…
comment by roblaszczak · 2018-01-08 · in Bleve: full-text search and indexing for Go -
…in `gometalinter` [2] (which is worth running as part of the CI checks on any Go codebase). [1] https://github.com/kisielk/errcheck [2] https://github.com/alecthomas/gometalinter
comment by jen20 · 2017-07-29 · in Going down the rabbit hole with go-fuzz -
…type error must always be assigned (and used). But it doesn't, and now there's the errcheck tool. https://github.com/kisielk/errcheck I agree that having things like errcheck and go-sumtype all wired up using gometalinter is pretty novel…
comment by frou_dh · 2017-03-21 · in Show HN: A utility for running exhaustiveness checks on “sum types” in Go -
…. 3. Go by design doesn't have exceptions. See https://golang.org/doc/faq#exceptions . github.com/kisielk/errcheck can be used to make sure errors are checked everywhere (but I agree this is not ideal). 4. I don't get that part. Sounds l
comment by ngrilly · 2016-08-25 · in Why I Don't Like Golang -
…since it isn't baked into the language but there are tools to do this at build time, here's one: https://github.com/kisielk/errcheck
comment by omni · 2016-08-21 · in What Golang Is and Is Not -
…(lexer and parser in standard library, simple AST, etc.), so there is a robust linger for that: https://github.com/kisielk/errcheck
comment by aleksi · 2016-03-19 · in Some Rookie Mistakes in Go -
…correctness that type system doesn't cover. Check, http://blog.golang.org/error-handling-and-go and https://github.com/kisielk/errcheck
comment by nexneo · 2015-02-24 · in Simplicity and the ideas Go left behind -
It is very easy to produce linters for Go to find things like unchecked errors, for example https://github.com/kisielk/errcheck
comment by NateDad · 2015-01-13 · in Errors are values -
…super repetitive and should be easy to catch on compile time. It is easy to catch on compile time. https://github.com/kisielk/errcheck
comment by cmelbye · 2015-01-13 · in Errors are values -
> I really prefer the Java "force you to catch exception" model much more to this. https://github.com/kisielk/errcheck/ will tell you if you silently discard the `err` value (though you can still explicitly assign it to _ to ignore). Seems…
comment by twotwotwo · 2015-01-13 · in Errors are values -
Which you can catch with a linter like https://github.com/kisielk/errcheck . Errors in Go are just values. There's nothing "more wrong" about ignoring a return value that is an error or one that is file handle, for example. And in cases…
comment by NateDad · 2014-12-30 · in Everyday hassles in Go -
…still call it thusly: foo() However there are tools to check for unchecked errors like this one: https://github.com/kisielk/errcheck
comment by NateDad · 2014-12-10 · in Option and null in dynamic languages -
…of this could be solved easily by either a compiler option or golint rule You mean like errcheck? https://github.com/kisielk/errcheck I'm not sure if it can find spots where people intentionally throw away an error like in val, _ := foo()…
comment by NateDad · 2014-11-14 · in Go is moving to GitHub -
…are afraid of it, run errcheck[1] on your code, and it'll tell you if you've missed anything. [1] https://github.com/kisielk/errcheck
comment by NateDad · 2014-08-14 · in Is Java the Cobol of tomorrow and Go the Java of the future? -
…For simply dropping all return values on the ground, there are linters that will complain for you: https://github.com/kisielk/errcheck
comment by NateDad · 2014-06-04 · in Go error handling -
add https://github.com/kisielk/errcheck to your continuous integration process.
comment by aaronblohowiak · 2014-04-09 · in Why Go is elegant and makes my code elegant -
…has had exceptional reliability, I verified I handled all error known conditions with errcheck ( https://github.com/kisielk/errcheck ) and just generally took the slow and plodding approach of handling everything explicitly. My app handles…
comment by MetaCosm · 2013-11-11 · in Docker and Go: why did we decide to write Docker in Go? -
Below, mseepgood pointed out https://github.com/kisielk/errcheck exists--looks excellent. (Still would be cool if the Gophers put something like it in the std distro.)
comment by twotwotwo · 2013-10-21 · in The Reliability of Go -
https://github.com/kisielk/errcheck
comment by mseepgood · 2013-10-20 · in The Reliability of Go