Skip to content

fix(lint): correctly disable govet inline analyzer & deprecated gomodguard#1574

Merged
zemzale merged 1 commit into
masterfrom
disable-inline-linter
May 18, 2026
Merged

fix(lint): correctly disable govet inline analyzer & deprecated gomodguard#1574
zemzale merged 1 commit into
masterfrom
disable-inline-linter

Conversation

@nodivbyzero
Copy link
Copy Markdown
Contributor

@nodivbyzero nodivbyzero commented May 13, 2026

Fixes Or Enhances

  • Move inline from linters.disable to settings.govet.disable to properly suppress Go 1.24+ false positives regarding reflect.Ptr constant inlining
  • Disable deprecated gomodguard linter to resolve golangci-lint v2 warnings

Related to: https://github.com/go-playground/validator/actions/runs/25698487406/job/75452753081

run golangci-lint
  Running [/home/runner/golangci-lint-2.12.2-linux-amd64/golangci-lint config path] in [/home/runner/work/validator/validator] ...
  Running [/home/runner/golangci-lint-2.12.2-linux-amd64/golangci-lint config verify] in [/home/runner/work/validator/validator] ...
  Running [/home/runner/golangci-lint-2.12.2-linux-amd64/golangci-lint run] in [/home/runner/work/validator/validator] ...
  Error: baked_in.go:390:23: inline: Constant reflect.Ptr should be inlined (govet)
  				if elem.Kind() == reflect.Ptr {
  				                  ^
  Error: baked_in.go:409:22: inline: Constant reflect.Ptr should be inlined (govet)
  			if elem.Kind() == reflect.Ptr {
  			                  ^
  Error: baked_in.go:431:20: inline: Constant reflect.Ptr should be inlined (govet)
  			if sf.Kind() == reflect.Ptr {
  			                ^
  3 issues:
  * govet: 3
  
  level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2."
  level=warning msg="Suggested new configuration:\nlinters:\n  enable:\n    - gomodguard_v2\n"
  
  Error: issues found
  Ran golangci-lint in 19996ms

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@nodivbyzero nodivbyzero requested a review from a team as a code owner May 13, 2026 04:03
@nodivbyzero nodivbyzero force-pushed the disable-inline-linter branch from 2133130 to 719824d Compare May 13, 2026 04:07
@nodivbyzero
Copy link
Copy Markdown
Contributor Author

@zemzale Could you please review this PR so we can unblock the dependabot PR merges?

Copy link
Copy Markdown
Member

@zemzale zemzale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was about to do the same thing 😆

LGTM

@zemzale zemzale merged commit cf37fce into master May 18, 2026
7 checks passed
@zemzale zemzale deleted the disable-inline-linter branch May 18, 2026 08:47
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