https://github.com/agrison/go-commons-lang
go-commons-lang
https://github.com/agrison/go-commons-lang
Last synced: over 1 year ago
JSON representation
go-commons-lang
- Host: GitHub
- URL: https://github.com/agrison/go-commons-lang
- Owner: agrison
- License: mit
- Created: 2016-02-19T15:05:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-06T07:52:36.000Z (over 2 years ago)
- Last Synced: 2024-06-18T18:45:20.458Z (about 2 years ago)
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 25
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-commons-lang
[][license]
[][godocs]
[][goreportcard]
[license]: https://github.com/agrison/go-commons-lang/blob/master/LICENSE
[godocs]: https://godoc.org/github.com/agrison/go-commons-lang
[goreportcard]: https://goreportcard.com/report/github.com/agrison/go-commons-lang
This is a package aiming at regrouping common utilities where it makes sense in the Go language.
It originated as a port of the popular Java Apache Commons StringUtils, but more will be added gradually.
| Package | Description |
| ------------- | ------------- |
| `stringUtils` | String Utilities reflecting what's available in [StringUtils](http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html) |
| `wordUtils` | String Utilities regarding words [WordUtils](http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/text/WordUtils.html) |
| `randUtils` | [RandomUtils](http://commons.apache.org/proper/commons-lang/apidocs/index.html?org/apache/commons/lang3/StringUtils.html) |
| `mathUtils` | `Fraction` implementation of Apache Commons |
## Usage: `stringUtils`
```go
package main
import (
"fmt"
strUtil "github.com/agrison/go-commons-lang/stringUtils"
)
func main() {
lib := strUtil.Join([]string{"lang", "commons", "go"}, "-")
fmt.Print(strUtil.Capitalize(strUtil.Reverse("olleh")))
fmt.Print(strUtil.SwapCase(strUtil.Chomp(" fROM \n")))
fmt.Println(strUtil.ReverseDelimited(lib, "-") + strUtil.Right("Go!! ", 2))
// Output: Hello From go-commons-lang!
// See the doc for all the implemented utilities
}
```
## Installation
```sh
go get github.com/agrison/go-commons-lang
```
## Join
PRs are more than welcome :)
## Author
[Alexandre Grison](https://github.com/agrison) and obviously all the contributors of the original Apache Commons Lang.