feat(container/gring): add generic ring feature#4496
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a generic ring data structure (TRing[T]) to the container/gring package and refactors the existing deprecated Ring type to use it internally. The implementation provides type-safe ring buffer operations while maintaining backward compatibility.
Key changes:
- Added
TRing[T], a generic ring structure with thread-safe operations for any type - Refactored deprecated
Ringto wrapTRing[any], eliminating code duplication - Created type alias
internalRingItempointing tointernalTRingItem[any]for consistency
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| container/gring/gring_t.go | Implements the new generic TRing[T] structure with all ring operations (set, get, move, link, unlink, iterate) |
| container/gring/gring.go | Refactors deprecated Ring to use TRing[any] as embedded field, delegating all operations to the generic implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ize slice initialization in SliceNext/SlicePrev
add TRing