Skip to content

Commit 22f61e2

Browse files
authored
Clarify exception: avoid embedding mutexes in all cases (uber-go#138)
1 parent 38c94e1 commit 22f61e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

style.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2593,9 +2593,11 @@ type Client struct {
25932593
Embedding should provide tangible benefit, like adding or augmenting
25942594
functionality in a semantically-appropriate way. It should do this with zero
25952595
adverse user-facing effects (see also: [Avoid Embedding Types in Public Structs]).
2596-
Generally, mutexes should not be embedded unless they are an integral part of the embedding type's API.
2596+
2597+
Exception: Mutexes should not be embedded, even on unexported types. See also: [Zero-value Mutexes are Valid].
25972598

25982599
[Avoid Embedding Types in Public Structs]: #avoid-embedding-types-in-public-structs
2600+
[Zero-value Mutexes are Valid]: #zero-value-mutexes-are-valid
25992601

26002602
Embedding **should not**:
26012603

0 commit comments

Comments
 (0)