-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(container/gmap): add generic map feature #4484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduce a generic KVMap[K,V] and refactor existing typed hash maps to embed and delegate behavior to it, centralizing map logic and reducing duplication.
- Add generic KVMap[K,V] with common map operations and concurrency control.
- Refactor StrStrMap, StrIntMap, StrAnyMap, IntStrMap, IntIntMap, IntAnyMap, AnyAnyMap to embed KVMap and forward methods.
- Add lazyInit helpers in wrappers and unify JSON/Unmarshal/DeepCopy via KVMap.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
Show a summary per file
File | Description |
---|---|
container/gmap/gmap_hash_k_v_map.go | New generic KVMap[K,V] implementation with map utilities, locking, JSON, deep copy, diff, etc. |
container/gmap/gmap_hash_str_str_map.go | Refactor to embed KVMap[string,string] and delegate methods; add lazyInit. |
container/gmap/gmap_hash_str_int_map.go | Refactor to embed KVMap[string,int] and delegate; add lazyInit. |
container/gmap/gmap_hash_str_any_map.go | Refactor to embed KVMap[string,any] and delegate; add lazyInit. |
container/gmap/gmap_hash_int_str_map.go | Refactor to embed KVMap[int,string] and delegate; add lazyInit. |
container/gmap/gmap_hash_int_int_map.go | Refactor to embed KVMap[int,int] and delegate; add lazyInit. |
container/gmap/gmap_hash_int_any_map.go | Refactor to embed KVMap[int,any] and delegate; add lazyInit. |
container/gmap/gmap_hash_any_any_map.go | Refactor to embed KVMap[any,any] and delegate; add lazyInit and updated Clone. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
add hash kvmap and let other hash map base on it.