Skip to content

Conversation

@deepdring
Copy link
Contributor

Optimize code using a more modern writing style. Official support from Go, for more details visit https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize.

@JoeKar
Copy link
Collaborator

JoeKar commented Aug 20, 2025

Then we could replace all interface{} with any too, because it was introduced in go 1.181 and we require already go 1.192.

BTW:
The PRs title doesn't really fit to the impl. (fmt.Appendf vs fmt.Append), right?

Besides of that good so far.

Footnotes

  1. https://pkg.go.dev/builtin#any

  2. go.mod#L39

@deepdring
Copy link
Contributor Author

Then we could replace all interface{} with any too, because it was introduced in go 1.181 and we require already go 1.192.

BTW: The PRs title doesn't really fit to the impl. (fmt.Appendf vs fmt.Append), right?

Besides of that good so far.

Footnotes

  1. https://pkg.go.dev/builtin#any
  2. go.mod#L39

Indeed, as you mentioned, there are some issues with the titles of my PRs. However, since I added changes to replace interface{} with any, I used a new PR title.

Please review when you have time. 😄

@deepdring deepdring changed the title refactor: replace []byte(fmt.Sprintf) with fmt.Appendf refactor: use a more modern writing style to simplify code Aug 21, 2025
Copy link
Contributor

@Andriamanitra Andriamanitra left a comment

Choose a reason for hiding this comment

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

I'm happy to see interface{} gone, but git grep 'interface{}' still finds a few – some of them are in the documentation so they need to be manually fixed.

@deepdring
Copy link
Contributor Author

I'm happy to see interface{} gone, but git grep 'interface{}' still finds a few – some of them are in the documentation so they need to be manually fixed.

Thank you for your response. I have made the changes, except for two instances in the documentation that I believe should be retained.

image

@JoeKar
Copy link
Collaborator

JoeKar commented Aug 21, 2025

I'm unsure if interface{} should really stay in plugins.md, especially when we look at the already exchanged arguments and returns in the documentation (see 1 as well).

Footnotes

  1. https://github.com/golang/tour/issues/1668

@deepdring
Copy link
Contributor Author

I'm unsure if interface{} should really stay in plugins.md, especially when we look at the already exchanged arguments and returns in the documentation (see 1 as well).

Footnotes

  1. tour: Clarify usage of any as an alias for interface{} in fmt.Print description golang/tour#1668

I asked Gemini and it suggested to remove interface{} in plugins.md. I made the changes as suggested.

@deepdring
Copy link
Contributor Author

Removed. Please review again.

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