pingcap / pingcap/tidb

Proposal to use atomic.Pointer[T] instead of atomic.Value

Open
#44,736 6 comments 0 reactions 1 assignee Claimed by @krishnaduttPanchagnula View on GitHub
good first issue type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

Currently, the usage of ```atomic.Value``` is prevalent in our codebase. However, I would like to propose using ```atomic.Pointer[T]``` instead. The reason being that ```atomic.Pointer[T]``` provides a clearer expression of the type, which can help in reducing type conversions.

Therefore, I suggest that we consider using ```atomic.Pointer[T]``` in our codebase wherever possible. This change will not only result in better code clarity but also improve the performance of our code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.