pingcap/tidb

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

Open

#44.736 geöffnet am 16. Juni 2023

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Go (6.186 Forks)batch import
good first issuetype/enhancement

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

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