Skip to content
/ go-exp Public

A little GO library that provides additional functionality for generic maps and sets

License

Notifications You must be signed in to change notification settings

adnsv/go-exp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-exp

GoDoc

A little GO library that provides additional functionality for generic maps and sets

Since the introduction of generics in GO, its experimental repository has a couple of packages that helps to write nicer code for slices and maps:

I felt like adding a bit more to it, therefore this add-on library was created.

Features

  • github.com/adnsv/go-exp/maps package

    • flattening maps into slices of key-value pairs
    • sorting key-value pairs by key and by value
    • merging maps with conflict resolution
    • inverting maps with duplicate key detection
    • one-liner range for loops for key-ordered or value-ordered iterating over existing maps
  • github.com/adnsv/go-exp/sets package

    • implements intersect, union, difference, and other set-like functionality for map[K comparable]struct{}

Documentation

Automatically generated documentation for the package can be viewed online here: http://pkg.go.dev/github.com/adnsv/go-exp

About

A little GO library that provides additional functionality for generic maps and sets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages