refactor: use reflect.TypeFor#682
Conversation
Signed-off-by: box4wangjing <box4wangjing@outlook.com>
|
@semyon-dev Hi, Could you please review this PR at your convenience? Thank you very much. |
semyon-dev
left a comment
There was a problem hiding this comment.
The migration itself looks safe and preserves the existing value-type semantics (T instead of *T).
One thing worth double-checking is that TypedAtomicStorageImpl intentionally expects non-pointer reflected types, while runtime usage operates on pointers (*ModelKey, *ModelData, etc.). This behavior already existed before the refactor, so the PR does not introduce it, but it's an important invariant for future changes.
|
One small note: the PR description says "replace all", but there are still several handwritten storage-related usages of The remaining
|
Try to use better api reflect.TypeFor instead of reflect.TypeOf when we have known the type.
More info golang/go#60088
Inspired by #653 and replace all.