From 8e1383ea6a9561610e00b8c7f401bca1257f9001 Mon Sep 17 00:00:00 2001 From: Oskar Haarklou Veileborg Date: Mon, 9 Jan 2023 20:28:08 +0100 Subject: Ensure immutability of sets (and maps with SetMany) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ed771c6..c547383 100644 --- a/README.md +++ b/README.md @@ -286,8 +286,8 @@ Please see the internal `defaultComparer` for an example, bearing in mind that i ## Set -The `Set` represents a collection of unique values. It uses a `map[T]struct{}`, so it carries over some characteristics from the built-in Go `map` type. -Values neeed to be `comparable`. +The `Set` represents a collection of unique values, and it is implemented as a +wrapper around a `Map[T, struct{}]`. Like Maps, Sets require a `Hasher` to hash keys and check for equality. There are built-in hasher implementations for most primitive types such as `int`, `uint`, and -- cgit v1.2.3