You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer/go-style-guide.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -343,7 +343,7 @@ Below are some general guidelines to follow for writing concurrent code:
343
343
-**Avoid buffered channels**: Use unbuffered channels unless there is a very good reason for using a buffered channel.
344
344
Unbuffered channels provide strong synchronization guarantees. Buffered channels are asynchronous and will not block
345
345
unless the channel is full. Buffered channels can also be slower than unbuffered channels.
346
-
-**Protect maps and slices**: Maps and slices cannot be accessed concurrently without locking. Doing so can lead to
346
+
-**Protect maps and slices**: Maps and slices cannot be accessed concurrently (when at least one goroutine is writing) without locking. Doing so can lead to
347
347
data races.
348
348
-**Never copy sync types**: see [above section](#do-not-copy-sync-entities).
349
349
-**Choose primitives or channels based on use case**: In general, the Go language writers tell us to prefer channels
0 commit comments