golang-set
golang-set copied to clipboard
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.
This PR implements `Append` method and resolves #92 . Test results: ```shell $ go test -cover PASS coverage: 94.8% of statements ok github.com/deckarep/golang-set/v2 0.767s ```
like java `equals` method of Object class
The internals of this library use a downcast of the Set interface to `*threadSafeSet` and `*threadUnsafeSet` everywhere. I'm unclear why an interface is used in this package when the logic...
I added `github.com/google/gofuzz` to do fuzzy testing. If you are against it, then I will remove the dependency and hardcode the test input, but that makes the testing less resilient....
Hello, I was wondering what your thoughts were on adding a func to create a Set from Map `mapset.NewSetFromMapKey[T](map[T]any)` `mapset.NewSetFromMapValue[T](map[any]T)` I find myself doing this often. Thought others might as...
We've got `NewSet(vals...T)` for creating a set from multiple values. But today I found myself wanting to add a slice of objects to an existing set... today I have to...
> It's helpful if everyone using the package can use the same name to refer to its contents, which implies that the package name should be good: short, concise, evocative....
Recently I use golang-set to help optimize a DFA generator. And I noticed DFA‘s compile time increased a lot. New code:  Before:  After:  pprof:  `golang-set` based...
It would be really valuable if this set type implemented the [BurntSushi `TextUnmarshaler` interface](https://github.com/BurntSushi/toml#using-the-encodingtextunmarshaler-interface), so it can be used with that library without needing to wrap the set (or fork...