pingcap/tidb

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

Open

#44,736 opened on 2023年6月16日

GitHub で見る
 (6 comments) (0 reactions) (1 assignee)Go (6,186 forks)batch import
good first issuetype/enhancement

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (平均マージ 14d 4h) (30d で 346 merged PRs)

説明

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.

コントリビューターガイド