{"repo":"tomarrell/wrapcheck","free":true,"listed":false,"github":"https://github.com/tomarrell/wrapcheck","clone":"git clone https://github.com/tomarrell/wrapcheck.git","description":"A Go linter to check that errors from external packages are wrapped","language":"Go","stars":373,"topics":["go","go-linter","error","check","linter","hacktoberfest"],"license":"MIT","category":"dev-tools","readme_excerpt":"Wrapcheck A simple Go linter to check that errors from external packages are wrapped during return to help identify the error source during debugging. More detail in this article Install Go = v1.22.0 Wrapcheck is also available as part of the golangci-lint meta linter. Docs and usage instructions are available here. When used with golangci-lint, configuration is integrated with the .golangci.yaml file. Configuration You can configure wrapcheck by using a .wrapcheck.yaml file in either the local directory, or in your home directory. Usage To lint all the packages in a program: Testing This linter is tested using analysistest , you can view all the test cases under the testdata directory. TLDR If you've ever been debugging your Go program, and you've seen an error like this pop up in your logs. Then you know exactly how painful it can be to hunt down the cause when you have many methods which looks just like the following: The problem here is that multiple method calls into the sql package can return the same error. Therefore, it helps to establish a trace point at the point where error handing across package boundaries occurs. To resolve this, simply wrap the error returned by the db.Conn.Get() call. Now, your logs will be more descriptive, and allow you to easily locate the source of your errors. A further step would be to enforce adding stack traces to your errors instead using errors.WithStack() however, enforcing this is out of scope for this linter for now. Why? Errors in","default_branch":null,"files":null,"tree":[],"storefront":"/r/tomarrell","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tomarrell/wrapcheck/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}