Skip to content

v2.0.0

Choose a tag to compare

@cmilesio cmilesio released this 13 Jul 00:25
· 13 commits to main since this release

v2 makes str smaller and more predictable without changing the reason it exists: readable string chains.

The API now has one name for each operation, follows Go's standard library where there is an established name, and handles Unicode consistently. Fluent operations such as Join, ToBase64, and FromBase64 remain part of the library.

Highlights

  • Standard library naming such as Trim, HasPrefix, HasSuffix, EqualFold, TrimPrefix, and TrimSuffix.
  • No aliases or compatibility shims. Each operation has one supported spelling.
  • Rune-aware indexing, slicing, padding, casing, and text limits.
  • Better word detection for camel case and acronyms such as HTTPRequestID.
  • Clear empty-search behavior and errors for invalid parsing or match patterns.
  • Improved Plural, Singular, Slug, Words, and WrapWords behavior for application code.
  • A generated API reference with examples that are built, run, and checked by the test suite.

Breaking changes

The module path is now:

import "github.com/goforj/str/v2"

Aliases and several narrow wrappers were removed, and some methods now use Go-style names or more explicit signatures. See the v1 to v2 migration guide for direct replacements and behavior changes.

Install

go get github.com/goforj/str/v2@v2.0.0

v2 requires Go 1.24 or newer and has no third-party dependencies.

Full Changelog: v1.3.0...v2.0.0