Tags: freeformz/sets
Tags
feat: Implement sql.Scanner interface (#24) * test: add map_test.go for testing map-related functionality * test: add comprehensive test cases for Map's Scan method * feat: add Scan method for Map type to support database scanning * refactor: extract common Scan method logic into shared scanValue function * test: add placeholder comment for additional Map type tests * test: add comprehensive Scan tests for all Map types * chore: other cleanups
Ergonomics, doc updates, simplify locking (#22) * Rename `New{MapWith,MapFrom,}` to `New{With,From,}` for ergonomic reasons. Sorry about the thrash. * Since the types are exposed, started to add godocs for each of the methods for the exposed types. * Removed the sync.Cond on the locked types. NFI why I had it there as it's not needed. #minor
Expose concrete types (#20) * Expose concrete types * Renames * func Map to func MapBy * func New to func NewMap * func NewFrom to func NewMapFrom * func NewWith to func NewMapWith * Set types are now exported, so that ... * Concrete types can be used in structs and json.Unmarshaled to. * sets.Map (basic set type) * sets.Locked (basic locked set type) * sets.Ordered (basic ordred set type) * sets.LockedOrdered (basic locked+ordered set type) * sets.SyncMap (sync.Map based set type) * Added more JSON tests, especially for above #minor * Update sync.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update sync.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
New helpers and small cleanups (#19) * Additional helpers: * Map - maps the items in the set and returns them as a new set * MapTo - maps the items in the set into a provided set * MapToSlice - maps the items in the set and returns them as a slice * Filter - filters the items in the set based on the function and returns a new set * Reduce - reduces the items in the set to a single value * ReduceRight - reduces the items in the ordered set, in backwards order, to a single value * ForEach - calls the provided function with each member of the set * ForEachRight - calls the provided function for each item in the ordered set, in backwards order. * Cleaned up some Examples so they now use New{Ordered,}With instead of New{Ordered,} and multiple Adds #minor
PreviousNext