{"id":15320403,"url":"https://github.com/resotto/gochk","last_synced_at":"2025-08-09T23:06:25.254Z","repository":{"id":57551595,"uuid":"298715852","full_name":"resotto/gochk","owner":"resotto","description":"Static Dependency Analysis Tool for Go Files","archived":false,"fork":false,"pushed_at":"2020-11-21T06:49:19.000Z","size":230,"stargazers_count":72,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T02:38:26.183Z","etag":null,"topics":["analysis","clean-architecture","dependency","go","golang","layered-architecture","static","tool"],"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/resotto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null},"funding":{"github":"resotto"}},"created_at":"2020-09-26T01:44:36.000Z","updated_at":"2024-12-11T15:19:54.000Z","dependencies_parsed_at":"2022-09-26T18:41:32.496Z","dependency_job_id":null,"html_url":"https://github.com/resotto/gochk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/resotto/gochk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resotto%2Fgochk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resotto%2Fgochk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resotto%2Fgochk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resotto%2Fgochk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/resotto","download_url":"https://codeload.github.com/resotto/gochk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resotto%2Fgochk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269649848,"owners_count":24453541,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"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":["analysis","clean-architecture","dependency","go","golang","layered-architecture","static","tool"],"created_at":"2024-10-01T09:08:24.699Z","updated_at":"2025-08-09T23:06:25.222Z","avatar_url":"https://github.com/resotto.png","language":"Go","funding_links":["https://github.com/sponsors/resotto"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/19743841/97435499-d7541280-1963-11eb-80e1-70d3d80f30cc.png\" /\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://codecov.io/gh/resotto/gochk\"\u003e\u003cimg src=\"https://codecov.io/gh/resotto/gochk/branch/master/graph/badge.svg?token=0YQPLUGIXA\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/resotto/gochk/actions\"\u003e\u003cimg src=\"https://github.com/resotto/gochk/workflows/build/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/resotto/gochk\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/resotto/gochk\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bestpractices.coreinfrastructure.org/projects/4380\"\u003e\u003cimg src=\"https://bestpractices.coreinfrastructure.org/projects/4380/badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/resotto/gochk?tab=overview\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/resotto/gochk\" alt=\"PkgGoDev\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/resotto/gochk/issues/1\"\u003e\u003cimg src=\"https://img.shields.io/badge/chat-on%20issue-yellow\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/resotto/gochk/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Static Dependency Analysis Tool for Go Files\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/19743841/97001249-0983ff80-1573-11eb-818f-9bdbffe8f762.gif\"\u003e\n  \u003ca href=\"https://asciinema.org/a/371171\" target=\"_blank\"\u003e\u003cimg src=\"https://asciinema.org/a/371171.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nWhat is Gochk?\n\n- Gochk analyzes statically whether .go files violate [Clean Architecture The Dependency Rule](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html#the-dependency-rule) or not, and prints its results.\n\n  \u003e This rule says that source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle.\n\nWhat problem does Gochk solve?\n\n- When Go codebase with Clean Architecture (or Layered Architecture) becomes larger, it might be Big Ball Of Mud by the Dependency Rule violation, and Gochk detects them.\n\nWhen to apply Gochk to codebase?\n\n- **Preferably, it is when the codebase is as small as possible.**\n  - In this phase, you can use Gochk with `-e=true` which means Gochk fails with exit code `1` when violations occur. So you can detect violations thoroughly and keep codes clean.\n- **If codebase is big, Gochk can also be applied to it.**\n  - You can just check whether it violates Dependency Rule or not and refactor it to have less violations.\n\nWho is the main user of Gochk?\n\n- Go Developer\n\nWhy Gochk?\n\n- **ZERO Dependency**\n- Simple \u0026 Easy-to-Read Outputs\n\n---\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Installation](#installation)\n- [How Gochk works](#how-gochk-works)\n- [How to see results](#how-to-see-results)\n- [Configuration](#configuration)\n- [Customization](#customization)\n- [Unit Testing](#unit-testing)\n- [Performance Test](#performance-test)\n- [Build](#build)\n- [GitHub Actions](#github-actions)\n- [Feedback](#feedback)\n- [Contributing](#contributing)\n- [Release Notes](#release-notes)\n- [License](#license)\n- [Author](#author)\n\n## Getting Started\n\n### Docker\n\nSee [Build](#build).\n\n### Local\n\n```zsh\ngo get -u github.com/resotto/gochk\ncd ${GOPATH}/src/github.com/resotto/gochk\n```\n\nPlease edit paths of `dependencyOrders` in `gochk/configs/config.json` according to your dependency rule, whose smaller index value means outer circle.\n\n```json\n\"dependencyOrders\": [\"external\", \"adapter\", \"application\", \"domain\"],\n```\n\nAnd then, let's gochk your target path with `-t`:\n\n```zsh\ngo run cmd/gochk/main.go -t=${YourTargetPath}\n```\n\nIf you have [Goilerplate](https://github.com/resotto/goilerplate), you can also gochk it:\n\n```zsh\ngo run cmd/gochk/main.go -t=../goilerplate\n```\n\nIf your current working directory is not in Gochk root `${GOPATH}/src/github.com/resotto/gochk`, you must specify the location of the `config.json` with `-c`:\n\n```zsh\ncd internal\ngo run ../cmd/gochk/main.go -t=../../goilerplate -c=../configs/config.json\n```\n\nMoreover, if you want to exit with `1` when violations occur, please specify `-e=true` (default `false`):\n\n```zsh\ngo run ../cmd/gochk/main.go -t=../../goilerplate -c=../configs/config.json -e=true\n```\n\n## Installation\n\nFirst of all, let's check `GOPATH` has already been set:\n\n```zsh\ngo env GOPATH\n```\n\nAnd then, please confirm that `${GOPATH}/bin` is included in your `$PATH`:\n\n```zsh\necho $PATH\n```\n\nFinally, please install Gochk:\n\n```zsh\ncd cmd/gochk\ngo install\n```\n\n## How Gochk works\n\n### Prerequisites\n\n- **Please format all .go files with one of the following format tools in advance, which means only one import statement in a .go file**.\n  - goimports\n  - goreturns\n  - gofumports\n- If you have files with following file path or import path, Gochk might not work well.\n  - The path including the two directory names specified in `dependencyOrders` of `gochk/configs/config.json`.\n    - For example, if you have the path `app/external/adapter/service` and want to handle this path as what is in `adapter`, and `dependencyOrders = [\"external\", \"adapter\"]`, the index of the path will be `0` (not `1`).\n\n### What Gochk does\n\nGochk checks whether .go files violate [Clean Architecture The Dependency Rule](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html#the-dependency-rule) or not, and prints its results.\n\n\u003e This rule says that source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle.\n\nFor example, if an usecase in \"Use Cases\" imports (depends on) what is in \"Controllers/Gateways/Presenters\", it violates dependency rule.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/19743841/93830264-afa9c480-fcaa-11ea-9589-7c5308c291f4.jpg\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html\"\u003eThe Clean Architecture\u003c/a\u003e\n\u003c/p\u003e\n\n### Check Logic\n\nFirstly, Gochk fetches the file path and gets the index of `dependencyOrders` in `gochk/configs/config.json` if one of them is included in the file path.\n\nSecondly, Gochk reads the file, parses import paths, and also gets the indices of `dependencyOrders` if matched.\n\nAnd then, Gochk compares those indices and detects violation **if the index of the import path is smaller than that of the file path**.\n\nFor example, if you have a file `app/application/usecase/xxx.go` with import path `\"app/adapter/service\"` and `dependencyOrders = [\"adapter\", \"application\"]`, the index of the file is `1` and the index of its import is `0`.  \nTherefore, the file violates dependency rule since the following inequality is established:\n\n- `0 (the index of the import path) \u003c 1 (the index of the file path)`\n\n## How to see results\n\n### Quick Check\n\nYou can check whether there are violations or not quickly by looking at the end of results.\n\nIf you see `Dependencies which violate dependency orders found!`, there are violations!🚨\n\n```\n2020/10/19 23:37:03 Dependencies which violate dependency orders found!\n```\n\nIf you see the following AA, congrats! there are no violations🎉\n\n```\n2020/10/19 23:57:25 No violations\n    ________     _______       ______    __     __    __   _ _\n   /  ______\\   /  ___  \\     /  ____\\  |  |   |  |  |  | /   /\n  /  /  ____   /  /   \\  \\   /  /       |  |___|  |  |  |/   /\n /  /  |_   | |  |     |  | |  |        |   ___   |  |      /\n \\  \\    \\  | |  |     |  | |  |        |  |   |  |  |  |\\  \\\n  \\  \\___/  /  \\  \\___/  /   \\  \\_____  |  |   |  |  |  | \\  \\\n   \\_______/    \\_______/     \\_______\\ |__|   |__|  |__|  \\__\\\n```\n\n### Result types\n\nGochk displays each result type in a different color by default:\n\n- ![#008080](https://via.placeholder.com/15/008080/000000?text=+) None\n  - which means there are imports irrelevant to dependency rule or no imports at all.\n- ![#008000](https://via.placeholder.com/15/008000/000000?text=+) Verified\n  - which means there are dependencies with no violation.\n- ![#FFFF00](https://via.placeholder.com/15/FFFF00/000000?text=+) Ignored\n  - which means the path is ignored (not checked).\n- ![#800080](https://via.placeholder.com/15/800080/000000?text=+) Warning\n  - which means something happened (and Gochk didn't check it).\n- ![#FF0000](https://via.placeholder.com/15/FF0000/000000?text=+) Violated\n  - which means there are dependencies which violates dependency rule.\n\nFor `None`, `Verified`, and `Ignored`, only the file path will be displayed.\n\n```\n[None]     ../goilerplate/internal/app/adapter/postgresql/conn.go\n```\n\n```\n[Verified] ../goilerplate/cmd/app/main.go\n```\n\n```\n[Ignored]  ../goilerplate/.git\n```\n\nFor `Warning`, it displays what happened to the file.\n\n```\n[Warning]  open /Users/resotto/go/src/github.com/resotto/goilerplate/internal/app/application/usecase/lock.go: permission denied\n```\n\nFor `Violated`, it displays the file path, its dependency, and how it violates dependency rule.\n\n```\n[Violated] ../goilerplate/internal/app/domain/temp.go imports \"github.com/resotto/goilerplate/internal/app/adapter/postgresql/model\"\n =\u003e domain depends on adapter\n```\n\n## Configuration\n\n### Changing Default Target Path, Config Path, and Exit Mode\n\nYou can modify default target path, config path, and exit mode in main.go:\n\n```go\nexitMode := flag.Bool(\"e\", false /* default value */, \"flag whether Gochk exits with 1 or not when violations occur. (false is default)\")\ntargetPath := flag.String(\"t\", \".\" /* default value */, \"target path (\\\".\\\" is default)\")\nconfigPath := flag.String(\"c\", \"configs/config.json\" /* default value */, \"configuration file path (\\\"configs/config.json\\\" is default)\")\n```\n\n### config.json\n\n`gochk/configs/config.json` has configuration values.\n\n```json\n{\n  \"dependencyOrders\": [\"external\", \"adapter\", \"application\", \"domain\"],\n  \"ignore\": [\"test\", \".git\"],\n  \"printViolationsAtTheBottom\": false\n}\n```\n\n- `dependencyOrders` are the paths of each circles in Clean Architecture.\n\n  - For example, if you have following four circles, you should specify them from the outer to the inner like: `[\"external\", \"adapter\", \"application\", \"domain\"]`.\n\n    - \"External\" (most outer)\n    - \"Adapter\"\n    - \"Application\"\n    - \"Domain\" (most inner, the core)\n\n  - If you have other layered architecture, you could specify its layers to this parameter as well.\n\n- `ignore` has the paths ignored by Gochk, which can be file path or dir path.\n\n  - If you have the directory you want to ignore, **specifying them might improve the performance of Gochk since it returns `filepath.SkipDir`**.\n\n```go\n// read.go\nfunc matchIgnore(ignorePaths []string, path string, info os.FileInfo) (bool, error) {\n\tif included, _ := include(ignorePaths, path); included {\n\t\tif info.IsDir() {\n\t\t\treturn true, filepath.SkipDir\n\t\t}\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}\n```\n\n- `printViolationsAtTheBottom` is the flag whether Gochk prints violations of the dependency rule at the bottom or not.\n\n  - If `true`, you can see violations at the bottom like:\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/19743841/97001729-d42be180-1573-11eb-90d4-8c68c37f1e04.gif\"\u003e\n  \u003c/p\u003e\n\n  - If `false`, you see them disorderly (by goroutine):\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/19743841/97001521-74353b00-1573-11eb-8437-fe980c3b34ab.gif\"\u003e\n  \u003c/p\u003e\n\n## Customization\n\n### Changing Result Color\n\nFirst, please add the ANSI escape code to print.go:\n\n```go\nconst (\n\tteal     color = \"\\033[1;36m\"\n\tgreen          = \"\\033[1;32m\"\n\tyellow         = \"\\033[1;33m\"\n\tpurple         = \"\\033[1;35m\"\n\tred            = \"\\033[1;31m\"\n\tnewColor       = \"\\033[1;34m\" // New color\n\treset          = \"\\033[0m\"\n)\n```\n\nAnd then, let's change color of result type in read.go:\n\n```go\nfunc newWarning(message string) CheckResult {\n\tcr := CheckResult{}\n\tcr.resultType = warning\n\tcr.message = message\n\tcr.color = newColor // New color\n\treturn cr\n}\n```\n\n### Tuning the Number of Goroutine\n\nIf `printViolationsAtTheBottom` is `false`, Gochk prints results with goroutine.\n\nYou can change the number of goroutine in print.go:\n\n```go\nfunc printConcurrently(results []CheckResult) {\n\tc := make(chan struct{}, 10) // 10 goroutines by default\n\tvar wg sync.WaitGroup\n\tfor _, r := range results {\n\t\tr := r\n\t\tc \u003c- struct{}{}\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer func() { \u003c-c; wg.Done() }()\n\t\t\tprintColorMessage(r)\n\t\t}()\n\t}\n\twg.Wait()\n}\n```\n\n## Unit Testing\n\nUnit test files are located in `gochk/internal/gochk`.\n\n```zsh\ngochk\n├── internal\n│   └── gochk\n│       ├── calc_internal_test.go # Unit test (internal)\n│       └── read_internal_test.go # Unit test (internal)\n└── test\n    └── testdata                  # Test data\n```\n\nSo you can do unit test like:\n\n```zsh\n~/go/src/github.com/resotto/gochk (master) \u003e go test ./internal/gochk/... # Please specify -v if you need detailed outputs\nok      github.com/resotto/gochk/internal/gochk (cached)\n```\n\nYou can also clean test cache with `go clean -testcache`.\n\n```zsh\n~/go/src/github.com/resotto/gochk (master) \u003e go clean -testcache\n~/go/src/github.com/resotto/gochk (master) \u003e go test ./internal/gochk/...\nok      github.com/resotto/gochk/internal/gochk 0.092s # Not cache\n```\n\n## Performance Test\n\nPerformance test file is located in `gochk/test/performance`.\n\n```zsh\ngochk\n└── test\n    └── performance\n        └── check_test.go # Performance test\n```\n\nThus, you can do performance test as follows. It will take few minutes.\n\n```zsh\n~/go/src/github.com/resotto/gochk (master) \u003e go test ./test/performance/...\nok      github.com/resotto/gochk/test/performance       61.705s\n```\n\n### Test Contents\n\nPerformance test checks 40,000 test files in `gochk/test/performance` and measures only how long it takes to do it.\n\n#### Note\n\n- Test files will be created before the test and be deleted after the test.\n- For each test directory, there will be 10,000 .go test files.\n\n```zsh\ngochk\n└── test\n    ├── performance\n    │   ├── adapter         # Test directory\n    │   │   ├── postgresql\n    │   │   │   └── model\n    │   │   ├── repository\n    │   │   ├── service\n    │   │   ├── view\n    │   │   ...             # Test files (g0.go ~ g9999.go)\n    │   ├── application     # Test directory\n    │   │   ├── service\n    │   │   ├── usecase\n    │   │   ...             # Test files (g0.go ~ g9999.go)\n    │   ├── domain          # Test directory\n    │   │   ├── factory\n    │   │   ├── repository\n    │   │   ├── valueobject\n    │   │   ...             # Test files (g0.go ~ g9999.go)\n    │   └── external        # Test directory\n    │       ...             # Test files (g0.go ~ g9999.go)\n    └── testdata\n        ├── adapter.txt     # Original file of performance/adapter/gX.go\n        ├── application.txt # Original file of performance/application/gX.go\n        ├── domain.txt      # Original file of performance/domain/gX.go\n        └── external.txt    # Original file of performance/external/gX.go\n```\n\nFor each file, it imports standard libraries and dependencies like:\n\n```go\npackage xxx\n\nimport (\n    // standard library imports omitted here\n\n    \"github.com/resotto/gochk/test/performance/adapter\"                  // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/adapter/postgresql\"       // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/adapter/postgresql/model\" // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/adapter/repository\"       // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/adapter/service\"          // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/adapter/view\"             // import this up to adapter\n    \"github.com/resotto/gochk/test/performance/application/service\"      // import this up to application\n    \"github.com/resotto/gochk/test/performance/application/usecase\"      // import this up to application\n    \"github.com/resotto/gochk/test/performance/domain/factory\"           // import this only in domain\n    \"github.com/resotto/gochk/test/performance/domain/repository\"        // import this only in domain\n    \"github.com/resotto/gochk/test/performance/domain/valueobject\"       // import this only in domain\n    \"github.com/resotto/gochk/test/performance/external\"                 // import this up to adapter\n)\n```\n\nIn performance test, `dependencyOrders` are:\n\n```go\nvar dependencyOrders = []string{\"external\", \"adapter\", \"application\", \"domain\"}\n```\n\nSo, the number of violations equals to:\n\n- domain\n  - there are 9 violations x 10,000 files = 90,000\n    - domain depends on application (x2)\n      ```go\n      \"github.com/resotto/gochk/test/performance/application/service\"\n      \"github.com/resotto/gochk/test/performance/application/usecase\"\n      ```\n    - domain depends on adapter (x6)\n      ```go\n      \"github.com/resotto/gochk/test/performance/adapter\"\n      \"github.com/resotto/gochk/test/performance/adapter/postgresql\"\n      \"github.com/resotto/gochk/test/performance/adapter/postgresql/model\"\n      \"github.com/resotto/gochk/test/performance/adapter/repository\"\n      \"github.com/resotto/gochk/test/performance/adapter/service\"\n      \"github.com/resotto/gochk/test/performance/adapter/view\"\n      ```\n    - domain depends on external (x1)\n      ```go\n      \"github.com/resotto/gochk/test/performance/external\"\n      ```\n- application\n  - there are 7 violations x 10,000 files = 70,000\n    - application depends on adapter (x6)\n      ```go\n      \"github.com/resotto/gochk/test/performance/adapter\"\n      \"github.com/resotto/gochk/test/performance/adapter/postgresql\"\n      \"github.com/resotto/gochk/test/performance/adapter/postgresql/model\"\n      \"github.com/resotto/gochk/test/performance/adapter/repository\"\n      \"github.com/resotto/gochk/test/performance/adapter/service\"\n      \"github.com/resotto/gochk/test/performance/adapter/view\"\n      ```\n    - application depends on external (x1)\n      ```go\n      \"github.com/resotto/gochk/test/performance/external\"\n      ```\n- adapter\n\n  - there is 1 violation x 10,000 files = 10,000\n    - adapter depends on external (x1)\n      ```go\n      \"github.com/resotto/gochk/test/performance/external\"\n      ```\n\n- external\n  - there are no violations.\n- Total\n  - 90,000 (domain) + 70,000 (application) + 10,000 (adapter) = 170,000 violations\n\n### Score\n\nFollowing scores are not cached ones and measured by two Macbook Pros whose spec is different.\n\n| CPU                             | RAM                    | 1st score | 2nd score | 3rd score | Average    |\n| :------------------------------ | :--------------------- | :-------- | :-------- | :-------- | :--------- |\n| 2.7 GHz Dual-Core Intel Core i5 | 8 GB 1867 MHz DDR3     | 99.53s    | 97.08s    | 93.88s    | **96.83s** |\n| 2 GHz Quad-Core Intel Core i5   | 32 GB 3733 MHz LPDDR4X | 59.64s    | 55.57s    | 52.09s    | **55.77s** |\n\n## Build\n\nFrom Gochk root directory `${GOPATH}/src/github.com/resotto/gochk`, please run:\n\n```zsh\ndocker build -t gochk:latest -f build/Dockerfile .\n```\n\nOr you can also pull the image from GitHub Container Registry:\n\n```zsh\ndocker pull ghcr.io/resotto/gochk:latest\n```\n\nAfter getting Gochk docker image, please prepare Dockerfile with the package you want to gochk:\n\n```Dockerfile\n# FROM gochk:latest\nFROM ghcr.io/resotto/gochk:latest\n\nRUN go get -u ${TargetPackage}\n\nWORKDIR /go/src/github.com/resotto/gochk\n\nENTRYPOINT [\"/go/bin/gochk\", \"-t=${TargetPackageRoot}\"]\n```\n\nAnd then, please build the docker image:\n\n```zsh\ndocker build -t gochk-${YourPackage}:latest .\n```\n\nFinally, let's gochk your target package on docker container:\n\n```zsh\ndocker run --rm -it gochk-${YourPackage}:latest\n```\n\n## GitHub Actions\n\nYou can gochk your package on GitHub Actions with following yml file:\n\n```yml\nname: gochk sample\n\non: [push]\n\njobs:\n  gochk-goilerplate:\n    runs-on: ubuntu-latest\n    container:\n      image: docker://ghcr.io/resotto/gochk:latest\n    steps:\n      - name: Clone Goilerplate\n        uses: actions/checkout@v2\n        with:\n          repository: resotto/goilerplate\n      - name: Run gochk\n        run: |\n          /go/bin/gochk -c=/go/src/github.com/resotto/gochk/configs/config.json\n```\n\n[This is the result](https://github.com/resotto/gochk/runs/1304800817):\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/19743841/97106961-1ab24500-1708-11eb-939d-275b08744a9f.png\"\u003e\n\u003c/p\u003e\n\n## Feedback\n\n- [Feel free to write your thoughts](https://github.com/resotto/gochk/issues/1).\n- Report a bug to [Bug report](https://github.com/resotto/gochk/issues/2).\n\n## Contributing\n\n\u003ca href=\"https://www.contributor-covenant.org/version/2/0/code_of_conduct/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg\" /\u003e\u003c/a\u003e\n\nSee [Contribution Guide](https://github.com/resotto/gochk/blob/master/CONTRIBUTING.md).\n\n## Release Notes\n\n[Release Notes](https://github.com/resotto/gochk/blob/master/CHANGELOG.md)\n\n## License\n\n[MIT License](https://github.com/resotto/gochk/blob/master/LICENSE).\n\n## Author\n\nResotto\n\n\u003ca href=\"https://github.com/resotto\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/19743841/97778118-4629a980-1bb8-11eb-97ed-76dcdbe50406.png\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/resotto3\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/19743841/97777698-52f8ce00-1bb5-11eb-93c9-b06e0c48b693.png\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sponsors/resotto\"\u003e\u003cimg src=\"https://img.shields.io/badge/Sponsor-ffffff?logo=github\u0026logoColor=pink\u0026style=flat-square\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresotto%2Fgochk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresotto%2Fgochk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresotto%2Fgochk/lists"}