{"id":13562155,"url":"https://github.com/Djarvur/go-err113","last_synced_at":"2025-04-03T18:32:45.856Z","repository":{"id":55117277,"uuid":"249152133","full_name":"Djarvur/go-err113","owner":"Djarvur","description":"  Golang linter to check the errors handling expressions","archived":false,"fork":false,"pushed_at":"2021-01-08T21:22:20.000Z","size":20,"stargazers_count":45,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T13:25:30.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Djarvur.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T09:38:00.000Z","updated_at":"2024-04-16T14:57:04.000Z","dependencies_parsed_at":"2022-08-14T12:31:00.767Z","dependency_job_id":null,"html_url":"https://github.com/Djarvur/go-err113","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djarvur%2Fgo-err113","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djarvur%2Fgo-err113/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djarvur%2Fgo-err113/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djarvur%2Fgo-err113/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Djarvur","download_url":"https://codeload.github.com/Djarvur/go-err113/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223010475,"owners_count":17072993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:05.208Z","updated_at":"2024-11-04T14:30:49.713Z","avatar_url":"https://github.com/Djarvur.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"= err113 image:https://godoc.org/github.com/Djarvur/go-err113?status.svg[\"GoDoc\",link=\"http://godoc.org/github.com/Djarvur/go-err113\"] image:https://travis-ci.org/Djarvur/go-err113.svg[\"Build Status\",link=\"https://travis-ci.org/Djarvur/go-err113\"] image:https://coveralls.io/repos/Djarvur/go-err113/badge.svg?branch=master\u0026service=github[\"Coverage Status\",link=\"https://coveralls.io/github/Djarvur/go-err113?branch=master\"]\nDaniel Podolsky\n:toc:\n\nGolang linter to check the errors handling expressions\n\n== Details\n\nStarting from Go 1.13 the standard `error` type behaviour was changed: one `error` could be derived from another with `fmt.Errorf()` method using `%w` format specifier.\n\nSo the errors hierarchy could be built for flexible and responsible errors processing.\n\nAnd to make this possible at least two simple rules should be followed:\n\n1. `error` values should not be compared directly but with `errors.Is()` method.\n1. `error` should not be created dynamically from scratch but by the wrapping the static (package-level) error.\n\nThis linter is checking the code for these 2 rules compliance.\n\n=== Reports\n\nSo, `err113` reports every `==` and `!=` comparison for exact `error` type variables except comparison to `nil` and `io.EOF`.\n\nAlso, any call of `errors.New()` and `fmt.Errorf()` methods are reported except the calls used to initialise package-level variables and the `fmt.Errorf()` calls wrapping the other errors.\n\nNote: non-standard packages, like `github.com/pkg/errors` are ignored completely.\n\n== Install\n\n```\ngo get -u github.com/Djarvur/go-err113/cmd/err113\n```\n\n== Usage\n\nDefined by link:https://pkg.go.dev/golang.org/x/tools/go/analysis/singlechecker[singlechecker] package.\n\n```\nerr113: checks the error handling rules according to the Go 1.13 new error type\n\nUsage: err113 [-flag] [package]\n\n\nFlags:\n  -V\tprint version and exit\n  -all\n    \tno effect (deprecated)\n  -c int\n    \tdisplay offending line with this many lines of context (default -1)\n  -cpuprofile string\n    \twrite CPU profile to this file\n  -debug string\n    \tdebug flags, any subset of \"fpstv\"\n  -fix\n    \tapply all suggested fixes\n  -flags\n    \tprint analyzer flags in JSON\n  -json\n    \temit JSON output\n  -memprofile string\n    \twrite memory profile to this file\n  -source\n    \tno effect (deprecated)\n  -tags string\n    \tno effect (deprecated)\n  -trace string\n    \twrite trace log to this file\n  -v\tno effect (deprecated)\n```\n\n== Thanks\n\nTo link:https://github.com/quasilyte[Iskander (Alex) Sharipov] for the really useful advices.\n\nTo link:https://github.com/jackwhelpton[Jack Whelpton] for the bugfix provided.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDjarvur%2Fgo-err113","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDjarvur%2Fgo-err113","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDjarvur%2Fgo-err113/lists"}