Skip to content

Commit 944b067

Browse files
committed
add a comment
1 parent d39c158 commit 944b067

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ring.go

+2
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ func (c *ringSharding) newRingShards(
349349
return
350350
}
351351

352+
// Warning: External exposure of `c.shards.list` may cause data races.
353+
// So keep internal or implement deep copy if exposed.
352354
func (c *ringSharding) List() []*ringShard {
353355
c.mu.RLock()
354356
defer c.mu.RUnlock()

0 commit comments

Comments
 (0)