creachadair/mds

Generic data structures and utility types in Go

Go

28

551 commits

updated Sep 24, 2026

See the code

README

mds

GoDoc CI

This repository defines generic data structures and utility types in Go.

The packages in this module are intended to be leaf libraries, and MUST NOT depend on packages outside this module, excepting only packages from the Go standard library, creachadair/msync, and selected golang.org/x/* packages on a case-by-case basis. Separate-package tests in this repository may depend on other packages, but such dependencies must be minimized.

Packages within the module may depend on each other, where appropriate.

This module is currently versioned v0, and thus packages here are subject to breaking changes. I will attempt to minimize such changes where practical, but I may revise package APIs from time to time. When making such changes, I will increment the minor version number as a signal that more substantial changes are included.

Although I wrote these packages mainly for my own use, they are intended to be general-purpose, and you are welcome to use and depend on them. If you do so, I would be grateful for you to file issues for any problems you may encounter. While I cannot promise extensive support, I will do my best to accommodate reasonable requests.

Data Structures

Several of the data-types in this module share common behaviors:

  • An Add method to add or update one or more elements in the container.
  • A Remove method to remove one or more elements from the container.
  • A Clear method that discards all the contents of the container.
  • A Peek method that returns an order statistic of the container.
  • An Each method that iterates the container in its natural order (usable as a range function).
  • An IsEmpty method that reports whether the container is empty.
  • A Len method that reports the number of elements in the container.

Packages

Utilities

  • cache [code] an in-memory key/value cache
  • compare [code] provides helpers for comparison of values
  • distinct [code] a probabilistic distinct-elements counter (CVM)
  • mbits [code] helpful functions for manipulating bits and bytes
  • mdiff [code], supports creating textual diff (example)
  • mnet [code] provides an in-memory network implementation compatible with the net package
  • mstr [code] helpful functions for manipulating strings
  • mtest [code] a support library for writing tests
  • shell [code] POSIX shell quoting and splitting
  • slice [code] helpful functions for manipulating slices
  • value [code] helpful functions for basic values and pointers
balanced-search-trees
circular-linked-list
comparison
diff
go
golang
heap
linked-list
queue
stack

creachadair/mds

Generic data structures and utility types in Go

Go

28

551 commits

updated Sep 24, 2026

See the code

README

mds

GoDoc CI

This repository defines generic data structures and utility types in Go.

The packages in this module are intended to be leaf libraries, and MUST NOT depend on packages outside this module, excepting only packages from the Go standard library, creachadair/msync, and selected golang.org/x/* packages on a case-by-case basis. Separate-package tests in this repository may depend on other packages, but such dependencies must be minimized.

Packages within the module may depend on each other, where appropriate.

This module is currently versioned v0, and thus packages here are subject to breaking changes. I will attempt to minimize such changes where practical, but I may revise package APIs from time to time. When making such changes, I will increment the minor version number as a signal that more substantial changes are included.

Although I wrote these packages mainly for my own use, they are intended to be general-purpose, and you are welcome to use and depend on them. If you do so, I would be grateful for you to file issues for any problems you may encounter. While I cannot promise extensive support, I will do my best to accommodate reasonable requests.

Data Structures

Several of the data-types in this module share common behaviors:

  • An Add method to add or update one or more elements in the container.
  • A Remove method to remove one or more elements from the container.
  • A Clear method that discards all the contents of the container.
  • A Peek method that returns an order statistic of the container.
  • An Each method that iterates the container in its natural order (usable as a range function).
  • An IsEmpty method that reports whether the container is empty.
  • A Len method that reports the number of elements in the container.

Packages

Utilities

  • cache [code] an in-memory key/value cache
  • compare [code] provides helpers for comparison of values
  • distinct [code] a probabilistic distinct-elements counter (CVM)
  • mbits [code] helpful functions for manipulating bits and bytes
  • mdiff [code], supports creating textual diff (example)
  • mnet [code] provides an in-memory network implementation compatible with the net package
  • mstr [code] helpful functions for manipulating strings
  • mtest [code] a support library for writing tests
  • shell [code] POSIX shell quoting and splitting
  • slice [code] helpful functions for manipulating slices
  • value [code] helpful functions for basic values and pointers
balanced-search-trees
circular-linked-list
comparison
diff
go
golang
heap
linked-list
queue
stack

Project health

Overall

6.2/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Latest release

v0.31.0 · Sep 1, 2026

Releases this year

29

Significant stargazers

Mike Danese

424 followers · starred Jul 2024

Andrew Dunham

361 followers · starred Jul 2024

Phil Pennock

122 followers · starred Jul 2024

Ryan Lopopolo

554 followers · starred Jul 2024