Skip to content
boyter

boyter/go-string

Useful string utility functions for Go projects. Either because they are faster than the common Go version or do not exist in the standard library.

Useful Go String methods

193 6GoPush 1d agoListed 1mo agoMIT

No GitHub topics on this repo.

  • Go98.5%
  • Assembly1.3%
  • Shell0.1%
View on GitHub

Report a problem

1 Review

go-string is a small, focused Go library, and that is its main strength. It does not try to be a general-purpose string framework. It mostly solves a practical performance problem: finding literal string matches, including case-insensitive matches, without paying the cost of the regexp engine. The README makes that pitch clearly, especially around IndexAll and IndexAllIgnoreCase, and the benchmark example is useful because it shows the kind of workload where the library can be much faster.

The codebase also looks more serious than its size suggests. It has tests for the main search behavior, fuzz tests, bug-regression tests, benchmarks, and architecture-specific SIMD assembly for amd64 and arm64, with fallback code for other platforms. HighlightString is a nice companion API because it lets callers take match indexes from IndexAll, IndexAllIgnoreCase, or regexp and turn them into highlighted output. That makes the package feel shaped by real search/indexing use cases rather than just a grab bag of helpers.

The project is easy to evaluate: around 190 stars, a small fork count, MIT licensing, Go package docs, no open issues, no open pull requests, and a v1 release. It is also dependency-light, with a tiny go.mod, which is exactly what I want from a low-level utility package. The inclusion of third-party license notes for the adapted fzf SIMD code is a good sign too.

The main improvement I would suggest is documentation polish. The README explains performance well, but it could use a compact API table with examples for every exported function, especially PermuteCase, PermuteCaseFolding, IsSpace, and StartOfRune. I would also call out Unicode behavior and limitations more explicitly, since case-insensitive matching across Unicode can surprise people. Finally, the latest GitHub release is from 2023 while go.mod now targets Go 1.24, so a fresh release or short maintenance note would make the project feel more current.

Overall, go-string is a good example of a small library with a clear reason to exist. If someone needs fast literal search indexes in Go, especially for real text documents, this looks useful and well tested enough to consider.