Skip to content

govet: add inline analyzer#6385

Closed
alexandear wants to merge 2 commits intogolangci:mainfrom
alexandear:govet-add-inline
Closed

govet: add inline analyzer#6385
alexandear wants to merge 2 commits intogolangci:mainfrom
alexandear:govet-add-inline

Conversation

@alexandear
Copy link
Member

The inline analyzer has been available since golang.org/x/tools@v0.38.0.


Checked the analyzer on golangci-lint's codebase:

diff --git a/.golangci.yml b/.golangci.yml
index 8c9f7789..e6605185 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -115,6 +115,7 @@ linters:
             - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Errorf
             - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Fatalf
       enable:
+        - inline
         - nilness
         - shadow
     errorlint:
make build
go build -o golangci-lint ./cmd/golangci-lint./golangci-lint run --enable-only govet
pkg/goanalysis/runner_loadingpackage.go:516:7: inline: Constant reflect.Ptr should be inlined (govet)
        case reflect.Ptr:
             ^
1 issues:
* govet: 1

@ldez
Copy link
Member

ldez commented Feb 24, 2026

This is a detector, not really a linter.

@ldez ldez closed this Feb 24, 2026
@ldez ldez added the declined label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants