{"id":13396793,"url":"https://github.com/go-critic/go-critic","last_synced_at":"2026-10-19T09:12:06.437Z","repository":{"id":32327005,"uuid":"132232698","full_name":"go-critic/go-critic","owner":"go-critic","description":"The most opinionated Go source code linter for code audit.","archived":false,"fork":false,"pushed_at":"2026-10-11T09:03:08.000Z","size":3891,"stargazers_count":2075,"open_issues_count":157,"forks_count":144,"subscribers_count":22,"default_branch":"master","last_synced_at":"2026-10-14T10:58:57.105Z","etag":null,"topics":["conventions","go","go-lintpack","golang","hacktoberfest","idiomatic-go","linter","lintpack","ruleguard","style-checker"],"latest_commit_sha":null,"homepage":"https://go-critic.com","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/go-critic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2018-05-05T09:17:26.000Z","updated_at":"2026-10-08T00:56:29.000Z","dependencies_parsed_at":"2026-09-09T03:34:44.412Z","dependency_job_id":null,"html_url":"https://github.com/go-critic/go-critic","commit_stats":{"total_commits":802,"total_committers":84,"mean_commits":9.547619047619047,"dds":0.7581047381546134,"last_synced_commit":"cd7da9a0e1b67ebbfd6a54bbf3be190902b6e760"},"previous_names":["pieselbois/kfulint"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/go-critic/go-critic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-critic","download_url":"https://codeload.github.com/go-critic/go-critic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/sbom","scorecard":{"id":431627,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-critic/go-critic","commit":"24d5174a39e4e9617a34c98f8ec4048d03854e52"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":4,"reason":"3 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":8,"reason":"Found 19/23 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/doc.yaml:14","Warn: no topLevel permission defined: .github/workflows/doc.yaml:1","Warn: no topLevel permission defined: .github/workflows/go.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/doc.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/doc.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/doc.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/doc.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/doc.yaml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/doc.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/go-critic/go-critic/release.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:29:06.089Z","repository_id":32327005,"created_at":"2025-08-19T03:29:06.089Z","updated_at":"2025-08-19T03:29:06.089Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38352880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["conventions","go","go-lintpack","golang","hacktoberfest","idiomatic-go","linter","lintpack","ruleguard","style-checker"],"created_at":"2024-07-30T18:01:03.298Z","updated_at":"2026-10-19T09:12:06.432Z","avatar_url":"https://github.com/go-critic.png","language":"Go","funding_links":[],"categories":["Library","代码分析","Code Analysis","开源类库","Linters","Open source library","Go","Repositories","Programming Languages","相关工具`go相关工具和插件`","相关工具","Libraries for creating HTTP middlewares"],"sub_categories":["路由器","Routers","代码分析","Misc","Code Analysis"],"readme":"# go-critic\n\n![Build Status](https://github.com/go-critic/go-critic/workflows/Go/badge.svg)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#code-analysis)\n[![Go Report Card][go-report-image]][go-report-url]\n[![coverage][coverage-image]][coverage-url]\n[![PRs Welcome][pr-welcome-image]][pr-welcome-url]\n\n[go-report-image]: https://goreportcard.com/badge/github.com/go-critic/go-critic\n[go-report-url]: https://goreportcard.com/report/github.com/go-critic/go-critic\n[coverage-image]: https://coveralls.io/repos/github/go-critic/go-critic/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/go-critic/go-critic?branch=master\n[pr-welcome-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg\n[pr-welcome-url]: https://github.com/go-critic/go-critic/blob/master/CONTRIBUTING.md\n\nHighly extensible Go source code linter providing checks currently missing from other linters.\n\n![Logo](https://avatars1.githubusercontent.com/u/40007520?s=300\u0026u=b44287d8845a63fb0102d5259710c11ea367bb13\u0026v=4)\n\nThere is never too much static code analysis. Try it out.\n\n## Features\n\n* Almost 100 diagnostics that check for [bugs](https://go-critic.github.io/overview#checkers-from-the-diagnostic-group), [performance](https://go-critic.github.io/overview#checkers-from-the-performance-group) and [style](https://go-critic.github.io/overview#checkers-from-the-style-group) issues\n* Extensible without re-compilation with [dynamic rules](https://quasilyte.dev/blog/post/ruleguard/)\n* Includes `#opinionated` checks with very strict and specific requirements\n* Self-documented: `go-critic doc \u003ccheckname\u003e` gives a checker description\n\n## Documentation\n\nThe latest documentation is available at [go-critic.com](https://go-critic.com/overview).\n\n## Installation\n\nFor most users, using `go-critic` under [golangci-lint](https://github.com/golangci/golangci-lint) is enough.\n\nPrecompiled `go-critic` binaries can be found at [releases](https://github.com/go-critic/go-critic/releases) page.\n\nIt can be installed in the usual Go way by running:\n\n```bash\ngo install -v github.com/go-critic/go-critic/cmd/go-critic@latest\n```\n\nTo build `go-critic` from sources, clone this repository and run `make go-critic`.\n\nOn macOS, you can also install `go-critic` using either Homebrew or MacPorts:\n\n[Homebrew](https://brew.sh)\n\n```zsh\nbrew install go-critic\n```\n\n[MacPorts](https://www.macports.org)\n\n```zsh\nsudo port install go-critic\n```\n\n## Usage\n\nBe sure `go-critic` executable is under your `$PATH`.\n\nUsage of **go-critic**: `go-critic [sub-command] [sub-command args...]`\nRun `go-critic` without arguments to get help output.\n\n```\nSupported sub-commands:\n\tcheck - run linter over specified targets\n\t\t$ go-critic check -help\n\t\t$ go-critic check -v -enable='paramTypeCombine,unslice' strings bytes\n\t\t$ go-critic check -v -enable='#diagnostic' -disable='#experimental,#opinionated' ./...\n\tversion - print linter version\n\t\t$ go-critic version\n\tdoc - get installed checkers documentation\n\t\t$ go-critic doc -help\n\t\t$ go-critic doc\n\t\t$ go-critic doc checkerName\n```\n\n`check` sub-command examples:\n\n```bash\n# Runs all stable checkers on `fmt` package:\ngo-critic check fmt\n\n# Run all stable checkers on `pkg1` and `pkg2`\ngo-critic check pkg1 pkg2\n\n# Run all stable checkers on `fmt` package and configure rangeExprCopy checker\ngo-critic check -@rangeExprCopy.sizeThreshold 128 fmt\n\n# Runs specified checkers on `fmt` package:\ngo-critic check -enable elseif,paramName fmt\n\n# Run all stable checkers on current dir and all its children recursively:\ngo-critic check ./...\n\n# Like above, but without `appendAssign` check:\ngo-critic check -disable=appendAssign ./...\n\n# Run all stable checkers on `foo.go` file:\ngo-critic check foo.go\n\n# Run stable diagnostics over `strings` package:\ngo-critic check -enable='#diagnostic' -disable='#experimental' strings\n\n# Run all stable and non-opinionated checks:\ngo-critic check -enableAll -disable='#experimental,#opinionated' ./src/...\n```\n\n\u003e To get a list of available checker parameters, run `go-critic doc \u003ccheckerName\u003e`.\n\nIn place of a single name, **tag** can be used. Tag is a named checkers group.\n\nTags:\n\n* `#diagnostic` - kind of checks that detect various errors in code\n* `#style` - kind of checks that find style issues in code\n* `#performance` - kind of checks that detect potential performance issues in code\n* `#experimental` - check is under testing and development. Disabled by default\n* `#opinionated` - check can be unwanted for some people. Disabled by default\n* `#security` -  kind of checks that find security issues in code. Disabled by default and empty, so will fail if enabled.\n\n## Contributing\n\nThis project aims to be contribution-friendly.\n\nOur chats: [English](https://t.me/go_critic_eng) or\n[Russian](https://t.me/go_critic_ru)\n([Telegram website](https://telegram.org/))\n\nWe're using an optimistic merging strategy most of the time.\nIn short, this means that if your contribution has some flaws, we can still merge it and then\nfix them by ourselves. Experimental and work-in-progress checkers are isolated, so nothing bad will happen.\n\nCode style is the same as in Go project, see [CodeReviewComments](https://go.dev/wiki/CodeReviewComments).\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\nIt also describes how to develop a new checker for the linter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-critic%2Fgo-critic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-critic%2Fgo-critic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-critic%2Fgo-critic/lists"}