Skip to content
/ slicy Public

A set of typesafe chainable slice helpers to reduce pain of working with slices

License

Notifications You must be signed in to change notification settings

mamal72/slicy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc license

[ ]Slicy

Slicy is a set of typesafe chainable slice helpers that help you work with slices easier.

Installation

go get github.com/mamal72/slicy
# or use dep, vgo, glide or anything else

Usage

Supported Types

  • byte
  • int
  • int8
  • int16
  • int32
  • int64
  • float32
  • float64
  • uint
  • uint8
  • uint16
  • uint32
  • uint64
  • string
  • interface{}

Implemented Methods

  • Filter
  • Map
  • Push
  • Pop
  • Shift
  • Unshift
  • Append
  • Concat
  • Every
  • Some
  • Includes
  • Len

Example

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"}

Build

This package is generated using genny. You can simply run go generate or make generate to build project.

Ideas || Issues

Just create an issue and describe it. I'll check it ASAP!

Contribution

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. ❤️

About

A set of typesafe chainable slice helpers to reduce pain of working with slices

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published