unique: document thread safety #69637
Labels
Documentation
Issues describing a change to documentation.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go version
go version go1.23.1 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Read https://pkg.go.dev/unique
What did you see happen?
No mention of concurrency or safety
What did you expect to see?
A sentence "unique.Make is safe for concurrent use by multiple goroutines."
Discussion
The general rule in Go documentation is that when something is not documented as thread-safe, then it should be regarded as not thread-safe.
However, the unique package is in fact thread-safe, and this undocumented fact is not obvious to some users.
I suggest to follow the example of:
The text was updated successfully, but these errors were encountered: