#2391·bleve

Modernize codebase using go fix

Author: kznLeafCreated Aug 10, 2026Updated Aug 10, 2026

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:

bash
go fix ./...

in the root directory. This made 410 changes. I roughly reviewed the changes which mainly include:

  1. Replacing interface{} with any, which accounts for the majority of the changes.
  2. Replacing certain logic with more idiomatic Go implementations, such as using strings.Builder for more efficient string concatenation and preferring range loops where appropriate:
ImageImage
  1. Leveraging newer built-in functions to reduce redundancy, such as replacing manual max/min calculations with built-in max and min. For example:
Image

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 :-)