Coder Social home page Coder Social logo

yasup's Introduction

Yet Another Slices Utility Package (for Go)

Go Report Card GoDoc

What is it

An auto-generated library that contains helper functions for primitive type slices and a code generator tool that you can use for your custom types.

Current helper functions include:

  • Insert an element at a given index
  • Delete an element at a given index
  • Contains an element
  • Index of an element in the slice, or -1 if not found
  • LastIndex of an element in the slice, or -1 if not found
  • Count the amount of elements in the slice that match a given one
  • Push an element to the end of the slice
  • Pop an element from the end of the slice
  • FrontPush: pushes an element to the start of the slice
  • FrontPop: pops an element from the start of the slice
  • Replace: replaces elements that match a given value with another given value N times
  • ReplaceAll: replaces all elements that match a given value with another given value
  • An Equals function for comparing slices
  • Shuffle functions: One that uses math/rand and one that uses crypto/rand

Examples of usage

YASUP is simple to use!

Using the library for slices of primitive types

See examples/main.go. It is runnable code that shows how to use many of the YASUP functions.

You can run the following command to see what that code prints:

go get github.com/J4RV/yasup
go run github.com/J4RV/yasup/examples
Using the generator tool for custom types

For an example about creating YASUP helper functions for non primitive or custom types, see examples/genericStructExample.bat.

yasup's People

Contributors

j4rv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.