Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

bobg/slices

Repository files navigation

Slices - generic utility functions for operating on slices

Go Reference Go Report Card Tests Coverage Status

This is slices, a collection of generic utility functions for operating on Go slices.

This collection is useful in three ways:

  • It encapsulates hard-to-remember Go idioms for inserting and removing elements to and from the middle of a slice;
  • It adds the ability to index from the right end of a slice using negative integers (for example, Get(s, -1) is the same as s[len(s)-1]); and
  • It includes Map, Filter, and a few other such functions for processing slice elements with callbacks