go-std-addons

module
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: MIT

README

go-std-addons

A set of wrappers and helpers for builtin types and standard library features.

Rationale

With the addition of Generics (in 1.18) and the upcoming range-func (coming in 1.23) language features, there are quite a few built-in types and standard library features that could benefit from wrappers / helpers based around these features.

In general, most of the inclusions will be for things which are:

  • a wrapper around an existing feature where new language features make it easier / safer to use
  • simple / common tasks where the language features can be leveraged

Packages

Current

None! For now...

Planned

Many of these are things I've built repeatedly in my projects.

  • typed Pools, with optional clear/init behaviour
  • higher-order functions on slices/maps/sequences:
    • map, reduce, filter, etc...
    • group by, partition, topN
    • re-jiggered existing functions, e.g.: Resize(arr, N) as a wrapper to slices.Grow(arr, n)
    • missing functions, e.g.: there's no slices.LastIndex|LastIndexFunc
  • a MergeFS type for io/fs to merge multiple filesystems

Directories

Path Synopsis
Package pair provides a simple Pair type to hold two values of potentially different types.
Package pair provides a simple Pair type to hold two values of potentially different types.
Package xerrors provides utilities for working with code that may panic with an error value.
Package xerrors provides utilities for working with code that may panic with an error value.
xiter module
Package xsync provides generic wrapper to build-in concurrent types in the sync package of the standard library.
Package xsync provides generic wrapper to build-in concurrent types in the sync package of the standard library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL