hashicorp / go-set

The go-set package provides generic Set implementations for Go, including HashSet for types with a Hash() function and TreeSet for orderable data
Mozilla Public License 2.0
118 stars 8 forks source link

common: some tweaks for common helper functions #66

Closed shoenig closed 1 year ago

shoenig commented 1 year ago

This PR renames TransformUnion to InsertSetFunc, and TransformSlice to SliceFunc which should be a bit more obvious to understand. Also, the "Union" methods on the set types are ones that return a newly created set, and so we are also now more consistent with how those are named.

Also adds a boolean return value to InsertSetFunc, which like the insertion methods on the set types returns true if the set was modified as a result of the operation. And adds test cases around being modified or not modified.

Cleans up a few doc strings.

shoenig commented 1 year ago

@zonewave I went back and forth on the naming of InsertSliceFunc again :sweat_smile:

If things look good to you I think we can go ahead and cut a release with all the examples and your bug fixes.