{"id":15404543,"url":"https://github.com/k1low/gostyle","last_synced_at":"2026-04-02T13:40:33.248Z","repository":{"id":193969085,"uuid":"689815003","full_name":"k1LoW/gostyle","owner":"k1LoW","description":"gostyle is a set of analyzers for coding styles.","archived":false,"fork":false,"pushed_at":"2026-03-26T00:34:59.000Z","size":429,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-26T22:38:33.035Z","etag":null,"topics":["coding-style","go","go-vet","hacktoberfest","staticanalysis"],"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/k1LoW.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"dco":null,"cla":null},"funding":{"github":"k1LoW","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-09-11T00:44:48.000Z","updated_at":"2026-03-26T00:34:51.000Z","dependencies_parsed_at":"2026-03-17T22:02:01.220Z","dependency_job_id":null,"html_url":"https://github.com/k1LoW/gostyle","commit_stats":{"total_commits":244,"total_committers":4,"mean_commits":61.0,"dds":0.3770491803278688,"last_synced_commit":"0bda47734367d5edc637e30e4fd033f2e2f251e2"},"previous_names":["k1low/gostyle"],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/k1LoW/gostyle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fgostyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fgostyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fgostyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fgostyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k1LoW","download_url":"https://codeload.github.com/k1LoW/gostyle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fgostyle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["coding-style","go","go-vet","hacktoberfest","staticanalysis"],"created_at":"2024-10-01T16:13:37.759Z","updated_at":"2026-04-02T13:40:33.241Z","avatar_url":"https://github.com/k1LoW.png","language":"Go","readme":"# gostyle\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/k1LoW/gostyle.svg)](https://pkg.go.dev/github.com/k1LoW/gostyle) [![build](https://github.com/k1LoW/gostyle/actions/workflows/ci.yml/badge.svg)](https://github.com/k1LoW/gostyle/actions/workflows/ci.yml) ![Coverage](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/gostyle/coverage.svg) ![Code to Test Ratio](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/gostyle/ratio.svg) ![Test Execution Time](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/gostyle/time.svg)\n\n`gostyle` is a set of analyzers for coding styles.\n\n## Disclaimer\n\n`gostyle` **IS NOT** [Go Style](https://google.github.io/styleguide/go/).\n\n\"Go Style\" in [Google Style Guides](https://google.github.io/styleguide) is a great style and we will actively refer to it, but we cannot implement the same rules perfectly, and we may extend the rules.\n\n`gostyle` **IS NOT STANDARD**.\n\n`gostyle` **IS** to help you maintain **YOUR** Go project coding **STYLE**.\n\n## Usage\n\n### As a Standalone CLI\n\n```console\n$ gostyle run ./...\n```\n\n### As a vet tool\n\n```console\n$ go vet -vettool=`which gostyle` ./...\n```\n\n### On GitHub Actions\n\n**:octocat: GitHub Actions for gostyle is [here](https://github.com/k1LoW/gostyle-action) !!**\n\n``` yaml\n# .github/workflows/ci.yml\non:\n  push:\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n[...]\n      -\n        uses: k1LoW/gostyle-action@v1\n        with:\n          config-file: .gostyle.yml\n[...]\n```\n\n## Analyzers\n\n**Although not perfect**, it provides analyzers based on helpful styles.\n\n### [Effective Go](https://go.dev/doc/effective_go)\n\n- [ifacenames](analyzer/effective/ifacenames) ... based on https://go.dev/doc/effective_go#interface-names\n\n\u003e [\"Effective Go\"](https://go.dev/doc/effective_go) by The Go Authors is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)\n\n### [Go Style](https://google.github.io/styleguide/go/) in Google Style Guides\n\n- [**Guide**](https://google.github.io/styleguide/go/guide)\n  - [mixedcaps](#mixedcaps) ... based on https://google.github.io/styleguide/go/guide#mixed-caps\n- [**Decisions**](https://google.github.io/styleguide/go/decisions)\n  - [funcfmt](#funcfmt) ... based on https://google.github.io/styleguide/go/decisions#function-formatting\n  - [getters](#getters) ... based on https://google.github.io/styleguide/go/decisions#getters\n  - [nilslices](#nilslices) ... based on https://google.github.io/styleguide/go/decisions#nil-slices\n  - [pkgnames](#pkgnames) ... based on https://google.github.io/styleguide/go/decisions#package-names\n  - [recvnames](#recvnames) ... based on https://google.github.io/styleguide/go/decisions#receiver-names\n  - [recvtype](#recvtype) ... based on https://google.github.io/styleguide/go/decisions#receiver-type\n  - [repetition](#repetition) ... based on https://google.github.io/styleguide/go/decisions#repetition\n  - [typealiases](#typealiases) ... based on https://google.github.io/styleguide/go/decisions#type-aliases\n  - [underscores](#underscores) ... based on https://google.github.io/styleguide/go/decisions#underscores\n  - [useany](#useany) ... based on https://google.github.io/styleguide/go/decisions#use-any\n  - [useq](#useq) ... based on https://google.github.io/styleguide/go/decisions#use-q\n  - [varnames](#varnames) ... based on https://google.github.io/styleguide/go/decisions#variable-names\n\n\u003e [\"Google Style Guides\"](https://google.github.io/styleguide/) by Google is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)\n\n### [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments) in Go wiki\n\n- [contexts](#contexts) ... based on https://go.dev/wiki/CodeReviewComments#contexts\n- [dontpanic](#dontpanic) ... based on https://go.dev/wiki/CodeReviewComments#dont-panic\n- [errorstrings](#errorstrings) ... based on https://go.dev/wiki/CodeReviewComments#error-strings\n- [handlerrors](#handlerrors) ... based on https://go.dev/wiki/CodeReviewComments#handle-errors\n\n## Disabling and Ignoring\n\n### Disable analyzer ( vet tool only )\n\nUse `-[analyser name].disable` flag.\n\n```console\n$ go vet -vettool=`which gostyle` -mixedcaps.disable # Disable mixedcaps analyzer only\n```\n\n### Ignore directive\n\n- `//lint:ignore`\n- `//nolint:all`\n- `//nostyle:all`\n- `//nostyle:[analyzer name]` (e.g. `//nostyle:mixedcaps`)\n\n## Configuration\n\n`gostyle` can be configured like [golangci-lint](https://golangci-lint.run/usage/configuration/).\n\n``` console\n$ gostyle init\n.gostyle.yml is generated\n# As a Standalone CLI\n$ gostyle run --config=.gostyle.yml ./...\n# As a vet tool\n$ go vet -vettool=`which gostyle` -gostyle.config=$PWD/.gostyle.yml ./...\n```\n\n\u003e [!NOTE]\n\u003e If no configuration file is specified, `gostyle` will automatically search for `.gostyle.yml` or `.gostyle.yaml` in the Git root directory.\n\n```yaml\n# .gostyle.yml\nanalyzers:\n  disable:\n    # Disable specific analyzers.\n    - analyzer-name\n# All available settings of specific analyzers.\nanalyzers-settings:\n  # See the dedicated \"analyzers-settings\" documentation section.\n  option: value\n# Exclude files from analysis.\nexclude-files:\n  - globbing\n```\n\n### `analyzers-settings:`\n\n#### contexts\n\n```yaml\nanalyzers-settings:\n  contexts:\n    include-generated: false # include generated codes (default: false)\n    exclude-test: true       # exclude test files (default: false)\n```\n\n#### dontpanic\n\n```yaml\nanalyzers-settings:\n  dontpanic:\n    include-generated: false # include generated codes (default: false)\n    exclude-test: true       # exclude test files (default: false)\n```\n\n#### errorstrings\n\n```yaml\nanalyzers-settings:\n  errorstrings:\n    include-generated: false # include generated codes (default: false)\n    exclude-test: true       # exclude test files (default: false)\n```\n\n#### funcfmt\n\n```yaml\nanalyzers-settings:\n  funcfmt:\n    include-generated: false # include generated codes (default: false)\n    check-calls: false       # check function and method calls in addition to declarations (default: false)\n```\n\n#### getters\n\n```yaml\nanalyzers-settings:\n  getters:\n    include-generated: false # include generated codes (default: false)\n    exclude:                 # exclude words\n      - GetViaHTTP\n```\n\n#### handlerrors\n\n( **NOT** handl**ee**rrors )\n\n```yaml\nanalyzers-settings:\n  handlerrors:\n    include-generated: false # include generated codes (default: false)\n    exclude-test: true       # exclude test files (default: false)\n```\n\n#### ifacenames\n\n```yaml\nanalyzers-settings:\n  ifacenames:\n    include-generated: false # include generated codes (default: false)\n    all: true                # all interface names with the -er suffix are required (default: false)\n```\n\n#### mixedcaps\n\n```yaml\nanalyzers-settings:\n  mixedcaps:\n    include-generated: false # include generated codes (default: false)\n    exclude:                 # exclude words\n      - DBTX\n      - EXPECT\n```\n\n#### nilslices\n\n```yaml\nanalyzers-settings:\n  nilslices:\n    include-generated: false # include generated codes (default: false)\n```\n\n#### pkgnames\n\n```yaml\nanalyzers-settings:\n  pkgnames:\n    include-generated: false # include generated codes (default: false)\n```\n\n#### recvnames\n\n```yaml\nanalyzers-settings:\n  recvnames:\n    include-generated: false # include generated codes (default: false)\n    max: 3                   # max length of receiver name (default: 2)\n```\n\n#### recvtype\n\n```yaml\nanalyzers-settings:\n  recvnames:\n    include-generated: false # include generated codes (default: false)\n```\n\n#### repetition\n\n```yaml\nanalyzers-settings:\n  repetition:\n    include-generated: false # include generated codes (default: false)\n    exclude:                 # exclude words\n      - limitStr\n```\n\n#### typealiases\n\n```yaml\nanalyzers-settings:\n  typealiases:\n    include-generated: false # include generated codes (default: false)\n    exclude:                 # exclude words\n      - TmpAliasHeader\n```\n\n#### underscores\n\n```yaml\nanalyzers-settings:\n  underscores:\n    include-generated: false # include generated codes (default: false)\n    exclude:                 # exclude words\n      - DBTX\n      - EXPECT\n```\n\n#### useany\n\n```yaml\nanalyzers-settings:\n  useany:\n    include-generated: false # include generated codes (default: false)\n```\n\n#### useq\n\n```yaml\nanalyzers-settings:\n  useq:\n    include-generated: false # include generated codes (default: false)\n```\n\n#### varnames\n\n```yaml\nanalyzers-settings:\n  varnames:\n    include-generated: false  # include generated codes (default: false)\n    small-scope-max: 5        # max lines for small scope (default: 7)\n    small-varname-max: 3      # max length of variable name for small scope (default: -1)\n    medium-scope-max: 10      # max lines for medium scope (default: 15)\n    medium-varname-max: 5     # max length of variable name for medium scope (default: -1)\n    large-scope-max: 15       # max lines for large scope (default: 25)\n    large-varname-max: 7      # max length of variable name for large scope (default: -1)\n    very-large-varname-max: 9 # max length of variable name for very large scope (default: -1)\n    exclude:                  # exclude words\n      - hostname\n```\n\n## Install\n\n**go install:**\n\n```console\n$ go install github.com/k1LoW/gostyle@latest\n```\n\n**deb:**\n\n``` console\n$ export GOSTYLE_VERSION=X.X.X\n$ curl -o gostyle.deb -L https://github.com/k1LoW/gostyle/releases/download/v$GOSTYLE_VERSION/gostyle_$GOSTYLE_VERSION-1_amd64.deb\n$ dpkg -i gostyle.deb\n```\n\n**RPM:**\n\n``` console\n$ export GOSTYLE_VERSION=X.X.X\n$ yum install https://github.com/k1LoW/gostyle/releases/download/v$GOSTYLE_VERSION/gostyle_$GOSTYLE_VERSION-1_amd64.rpm\n```\n\n**apk:**\n\n``` console\n$ export GOSTYLE_VERSION=X.X.X\n$ curl -o gostyle.apk -L https://github.com/k1LoW/gostyle/releases/download/v$GOSTYLE_VERSION/gostyle_$GOSTYLE_VERSION-1_amd64.apk\n$ apk add gostyle.apk\n```\n\n**homebrew tap:**\n\n```console\n$ brew install k1LoW/tap/gostyle\n```\n\n**[aqua](https://aquaproj.github.io/):**\n\n```console\n$ aqua g -i k1LoW/gostyle\n```\n\n**manually:**\n\nDownload binary from [releases page](https://github.com/k1LoW/gostyle/releases)\n","funding_links":["https://github.com/sponsors/k1LoW"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fgostyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk1low%2Fgostyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fgostyle/lists"}