Package stringz extends the standard library strings with additional functions.
go get -u ezpkg.io/stringz@v0.2.2The stdlib strings.Builder provides many functions that always return nil error. They have their counterparts in stringz.Builder that eliminate the need of error handling.
// stdlib: strings.Builder
_, err = b.WriteString()
if err != nil {
return err
}
_, err = fmt.Fprintf(&b, "Hello, %s!", "world")
if err != nil {
return err
}
// ezpkg.io/stringz.Builder
b.WriteStringZ()
b.Printf("Hello, %s!", "world")As I work on various Go projects, I often find myself creating utility functions, extending existing packages, or developing packages to solve specific problems. Moving from one project to another, I usually have to copy or rewrite these solutions. So I created this repository to have all these utilities and packages in one place. Hopefully, you'll find them useful as well.
For more information, see the main repository.