Skip to content

Support both possible go-critic binary names#50

Closed
mcdonnnj wants to merge 1 commit intoTekWizely:masterfrom
mcdonnnj:bug/support_either_gocritic_binary
Closed

Support both possible go-critic binary names#50
mcdonnnj wants to merge 1 commit intoTekWizely:masterfrom
mcdonnnj:bug/support_either_gocritic_binary

Conversation

@mcdonnnj
Copy link
Copy Markdown

@mcdonnnj mcdonnnj commented Mar 5, 2026

In #45 the expected binary for go-critic was changed from gocritic to go-critic based on an effort to change binary names in the go-critic project (go-critic/go-critic#1481 and go-critic/go-critic#1482). However, even now the default binary is still gocritic if you install the project and not the go-critic command specifically. The same is true if you install using brew (per the formula)). Thus it makes sense to check for the legacy binary name (gocritic) and only if it is not found use the newer go-critic name.

I verified with pre-commit try-repo that this works as expected after installing go-critic with brew.

Even though go-critic is moving to name its binary `go-critic` it will
still install as `gocritic` if you do not specifically install the
`go-critic` command.
@TekWizely
Copy link
Copy Markdown
Owner

Hi @mcdonnnj and thanks for taking the time to create an issue!

I ended up creating a similar PR with a slightly different approach:

If you have any time to verify that branch and report back, it would be much appreciated.

-TW

@mcdonnnj
Copy link
Copy Markdown
Author

Closed in favor of #52.

@mcdonnnj mcdonnnj closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants