Stringfy - Simple string manipulation packages for Go

I did this package -> https://github.com/hgsigner/stringfy
Stringfy is a collection of simple string manipulation packages for GO. I’m planning to add more.

Feedbacks are more than welcomed!

I hope yous guys like it :wink:
Hugo

Functionality looks great!

But every perform need to import a package is kind of annoying(in my opinion).

You might want to take a look at https://github.com/huandu/xstrings as well. :smiley:

1 Like

Great!

I agree with @Unknwon, no need for separate packages. Instead of camelcase.PerformOn(string) string, use stringify.CamelCase(string) string and similar.

Be sure to document everything your function does. For instance “underscore” also trims leading/trailing whitespace, but documentation doesn’t mention it. Add a few examples - you already have examples in your tests, if you add them as testable examples they will also show up in the godoc.

The “escaper” seems “magic”. What decides what is in the substitution table? See Text normalization in Go and maybe this implementation derived from it for a less “magic” way of handling this.

3 Likes

Great, guys! You guys feedback was awesome. I’ll try to refactor the points you guys showed me.
Thanks!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.