Conversation
* 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
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR exposes concrete types and renames several constructors and utility functions to improve discoverability and type safety. Key changes include:
- Renaming functions (e.g. Map → MapBy, New → NewMap, etc.) and exporting concrete types.
- Updating JSON marshaling/unmarshaling and test examples to use the new names.
- Adding new tests to verify JSON behavior for the updated set types.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sync.go | Exports SyncMap and updates all sync-based set functions |
| set_test.go | Updates test cases to use the new constructor and function names |
| set.go | Renames Map to MapBy and uses NewMap for instantiation |
| ordered.go | Exports Ordered type and adjusts return types accordingly |
| map.go | Exports Map type and updates associated constructor functions |
| locker.go | Adds a new locker interface for concurrency abstraction |
| locked_ordered.go | Exports LockedOrdered and revises locking semantics |
| locked.go | Exports Locked type and refines JSON unmarshaling logic |
| examples_test.go | Updates examples to reflect the new naming conventions |
| README.MD | Updates documentation to refer to MapBy instead of Map |
| CHANGELOG.MD | Documents renames and new features in the changelog |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Owner
Author
|
That was interesting. Never did a "copilot review" before. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#minor