feat(container/gmap): add generic map feature#4484
Conversation
There was a problem hiding this comment.
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 <[email protected]>
There was a problem hiding this comment.
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 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 22 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
add hash kvmap and let other hash map base on it.