Popularity
1.5
Declining
Activity
0.0
Stable
18
3
0

Description

Go team released Go 1.18 beta recently with support for Generics(a.k.a type parameters). This package provides much needed and frequently used utility functions for generic data types.

Programming language: Go
License: MIT License
Tags: Utilities     Go     Golang     Generics    

GOUF alternatives and similar packages

Based on the "Utilities" category.
Alternatively, view gouf alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of GOUF or a related project?

Add another 'Utilities' Package

README

GOUF - Utility Functions for generic types

Go team released Go 1.18 beta recently with support for Generics(a.k.a type parameters). This package provides much needed and frequently used utility functions for generic data types.

Supported Operations

Slices

  • All - Check if all elements in a slice satisfy a condition
  • Any - Check if any element in a slice satisfies a condition
  • Check - Check if slice can accept a given indices
  • Count - count all elements in a slice that satisfy a condition
  • Delete - Delete element at given index
  • DeleteUnordered - Delete element at given index, without preserving order(efficient than Delete)
  • DeleteFn - Delete element that satisfies a condition
  • DeletePlaces - Delete elements at given indices
  • Filter - Filter elements in a slice that satisfy a condition
  • FilterInPlace - Filter elements in a slice that satisfy a condition without allocating new slice(efficient than Filter)
  • FilterInPlaceGC - Filter elements in a slice that satisfy a condition without allocating new slice and zeroing wanted elements(efficient than Filter)
  • FindFn - Find element in a slice(for comparable types)
  • FindFn - Find element in a slice that satisfies a condition
  • Map - Map elements in a slice
  • Reduce - Reduce elements in a slice to a single value
  • Sum - Sum all elements in a slice (for numeric/string types)
  • SumFn - Sum all elements in a slice that satisfy a condition(for custom types)
  • Unique - Remove duplicate elements in a slice (for comparable types)
  • UniqueFn - Remove duplicate elements in a slice that satisfy a condition(for custom types)
  • UniqueInPlace - Remove duplicate elements in a slice without allocating new slice(efficient than Unique)
  • UniqueFnInPlace - Remove duplicate elements in a slice without allocating new slice(efficient than UniqueFn)

And a lot more(in pipeline).

Maps

TBD

Want to contribute?

see [guide](CONTRIBUTING.md).

Contact

Akshay Bharambe

Feedback

This is very much important to improve this package. Do let me know if you have any feedback. Leave a ⭐ if you find this helpful.