Skip to content

Conversation

@suranmiao
Copy link
Contributor

@suranmiao suranmiao commented Oct 17, 2025

strings.Builder has fewer memory allocations and better performance.
More info: golang/go#75190

Try to use better api reflect.TypeFor instead of reflect.TypeOf when we have known the type.
More info golang/go#60088

@suranmiao
Copy link
Contributor Author

@gacevicljubisa Hi, Could you please review this PR at your convenience? Thank you very much.

@akrem-chabchoub
Copy link
Contributor

@suranmiao Thank you for your contribution!

I tried running the command on the master branch, but it didn’t seem to trigger any changes.
Are all the changes in your PR automatically generated by running the following command you provied in the description?
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...

@gacevicljubisa
Copy link
Member

@suranmiao changes look good, but title and description are not matching the changes itself.

@suranmiao
Copy link
Contributor Author

@suranmiao Thank you for your contribution!

I tried running the command on the master branch, but it didn’t seem to trigger any changes. Are all the changes in your PR automatically generated by running the following command you provied in the description? go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...

I conducted related research, and it seems that the code for the tools has a fallback. Currently, it requires compiling a binary executable to achieve this.

@suranmiao suranmiao changed the title chore: modernize codebase for go 1.25 chore: use strings.Builder and reflect.TypeFor to simplify code Nov 5, 2025
Signed-off-by: suranmiao <solsui@outlook.com>
@suranmiao
Copy link
Contributor Author

@suranmiao changes look good, but title and description are not matching the changes itself.

@gacevicljubisa Thanks. Modified.

Please review it again.

@gacevicljubisa gacevicljubisa self-requested a review November 5, 2025 09:43
@gacevicljubisa gacevicljubisa merged commit 46bf911 into ethersphere:master Nov 10, 2025
3 checks passed
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.

3 participants