Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hedarikun/ano
a wrapper around go-lang arrays to make dealing with them easy
https://github.com/hedarikun/ano
Last synced: 8 days ago
JSON representation
a wrapper around go-lang arrays to make dealing with them easy
- Host: GitHub
- URL: https://github.com/hedarikun/ano
- Owner: HedariKun
- License: mit
- Created: 2022-10-29T09:43:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-05T10:08:49.000Z (about 2 years ago)
- Last Synced: 2024-06-20T15:03:56.813Z (5 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# Ano
A way to wrap arrays in golang to be able to manipulate them without writing any additional functions or methods# Usage
you can start using it by adding the module using `go get github.com/hedarikun/ano` then you can import it in your project.## Example usage of Ano
```go
package mainimport (
"github.com/hedarikun/ano"
)func main() {
list := []int{1, 2, 3, 4, 5}
list = ano.Wrap(list).Map(func(element int) int { return element * 2 }).Get()
for _, item := range list {
println(item)
}
}
```
# What functions does it have
- `Map` to Map the values of a list to different Values with the same type
- `GenericMap` to Map the values of a list to different Values With different Type - it will return anoHelper object that you can get a new Ano object with the desired Type by using `ano.DefineType` Function
- `Filter` to Filter the values of a list based on a rule