Thank you for maintaining the bleve project. I would like to propose a code optimization suggestion.
The idea came up while I was using bleve API and noticed that interface{} types haven't been replaced with any yet. Considering that the Go team enhanced the go fix command a few months ago (See: https://go.dev/blog/gofix ), I tried running:
in the root directory. This made 410 changes. I roughly reviewed the changes which mainly include:
- Replacing
interface{} with any, which accounts for the majority of the changes.
- Replacing certain logic with more idiomatic Go implementations, such as using
strings.Builder for more efficient string concatenation and preferring range loops where appropriate:
- Leveraging newer built-in functions to reduce redundancy, such as replacing manual max/min calculations with built-in max and min. For example:
Therefore my suggestion is that you can use go fix to modernize and standardize the codebase, and I believe this would be meaningful for maintaining overall code quality.
(English is not my native language, so I used machine translation to help write this text. Please excuse any awkward phrasing :-)
Thank you for maintaining the bleve project. I would like to propose a code optimization suggestion.
The idea came up while I was using bleve API and noticed that
interface{}types haven't been replaced withanyyet. Considering that the Go team enhanced thego fixcommand a few months ago (See: https://go.dev/blog/gofix ), I tried running:in the root directory. This made 410 changes. I roughly reviewed the changes which mainly include:
interface{}withany, which accounts for the majority of the changes.strings.Builderfor more efficient string concatenation and preferringrangeloops where appropriate:Therefore my suggestion is that you can use
go fixto modernize and standardize the codebase, and I believe this would be meaningful for maintaining overall code quality.(English is not my native language, so I used machine translation to help write this text. Please excuse any awkward phrasing :-)