Go-Humanizer is a Go module designed to simplify the process of text manipulation in various common formats. It provides functionality to convert singular words to plural and vice versa, and to convert text to Pascal, camel, snake, or kebab case.
The module is heavily inspired by the Humanizer project for .NET. Some parts have been ported and adapted to Go, while other parts have been written from scratch.
- Singular to Plural and Plural to Singular: This feature allows you to easily convert words between singular and plural forms.
- Case Conversion: Go-Humanizer can convert text between various cases, including Pascal, camel, snake, and kebab case.
To use the go-humanizer
module in your Go application, follow these steps:
-
Install the Go-Humanizer module by running the following command in your terminal:
go get github.com/wernerstrydom/go-humanizer
-
Reference the module in your application by adding the following import statement:
import ( "github.com/wernerstrydom/go-humanizer/en" )
-
Use the API to perform the desired text manipulation.
func main() { value := en.Plural("Person") println(value) }
To build the Go-Humanizer module, follow these steps:
- Clone the repository to your local machine.
- Navigate to the directory containing the
go-humanizer
module. - Run
go build
to compile the module.
To run the tests for the Go-Humanizer module, use the go test
command in
the directory containing the go-humanizer module.
Contributions to Go-Humanizer are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes in the new branch.
- Submit a pull request to merge your branch into the main repository.
Before submitting your pull request, please ensure that your code adheres
to the existing style conventions of the go-humanizer
codebase and that
all tests pass.
To release a new version of Go-Humanizer, follow these steps:
-
Create a new tag
git tag -a v0.1.5 -m "Version 0.1.5"
-
Push the tag to GitHub
git push origin v0.1.5
-
Run go list
go list -m github.com/wernerstrydom/[email protected]
And then verify that the version is correct, and working.
Go-Humanizer is licensed under the MIT License.
Go-Humanizer is inspired by the Humanizer