Make sure you have Go installed (download). Version 1.13
or higher is required.
Initialize your project by creating a folder and then running go mod init github.com/your/repo
(learn more) inside the folder. Then install Gotil with the go get
command:
go get -u github.com/gotilty/gotil/v1.0.0
GOtil makes go easier by taking the hassle out of working with arrays, numbers, objects, strings, etc. GOtil's modular methods are great for:
- Iterating arrays, objects, & strings
- Manipulating & testing values
- Creating composite functions
Listed below are some of the common examples. If you want to see more code examples , please visit our Recipes repository or visit our hosted API documentation.
data := []int64{10, 20, 30}
_ = Each(data, func(val interface{}, i int) {
fmt.Printf("%d apples", val)
})
// Output: [10 apples 20 apples 30 apples]