Slicy is a set of typesafe chainable slice helpers that help you work with slices easier.
go get github.com/mamal72/slicy
# or use dep, vgo, glide or anything else
byte
int
int8
int16
int32
int64
float32
float64
uint
uint8
uint16
uint32
uint64
string
interface{}
Filter
Map
Push
Pop
Shift
Unshift
Append
Concat
Every
Some
Includes
Len
Here is a simple example of string slice:
s := slicy.NewFromStringSlice([]string{"my", "string", "slice", "no!"})
s.Filter(func(item string) {
return item != "no!"
})
// You may call other methods here...
result := s.GetSlice() // returns a *[]string containing {"my", "string", "slice"}
This package is generated using genny. You can simply run go generate
or make generate
to build project.
Just create an issue and describe it. I'll check it ASAP!
You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️