Skip to content

Go modernize#638

Merged
christos68k merged 3 commits intomainfrom
go-modernize
Jul 21, 2025
Merged

Go modernize#638
christos68k merged 3 commits intomainfrom
go-modernize

Conversation

@florianl
Copy link
Copy Markdown
Member

This is an automated code update using the following command:

$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...

florianl added 2 commits July 21, 2025 11:27
This is an automated code update using the following command:

```
$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
```

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@florianl florianl requested review from a team as code owners July 21, 2025 09:32
Copy link
Copy Markdown
Contributor

@fabled fabled left a comment

Choose a reason for hiding this comment

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

Lgtm. One stylistic nit.

Comment thread kallsyms/kallsyms.go Outdated
@rockdaboot
Copy link
Copy Markdown
Contributor

It misses these linter findings. Fixing those would allow us to enable the copyloopvar linter.

processmanager/ebpf/ebpf_integration_test.go:56:3: The copy of the 'for' variable "name" can be deleted (Go 1.22+) (copyloopvar)
                name := name
                ^
processmanager/ebpf/ebpf_integration_test.go:57:3: The copy of the 'for' variable "test" can be deleted (Go 1.22+) (copyloopvar)
                test := test
                ^
tracer/ebpf_integration_test.go:201:3: The copy of the 'for' variable "testcase" can be deleted (Go 1.22+) (copyloopvar)
                testcase := testcase
                ^

While is "hidden" behind Go build flags (and modernize doesn't support them), I wonder why modernize only fixes a few intrange occurrences, but by far not all.

Copy link
Copy Markdown
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

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

Great! Nice step forward.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@christos68k christos68k merged commit d532b33 into main Jul 21, 2025
27 checks passed
@christos68k christos68k deleted the go-modernize branch July 21, 2025 13:55
gnurizen pushed a commit to parca-dev/opentelemetry-ebpf-profiler that referenced this pull request Sep 11, 2025
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
gnurizen pushed a commit to parca-dev/opentelemetry-ebpf-profiler that referenced this pull request Sep 12, 2025
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
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.

4 participants