Skip to content

Commit 2f2cc2f

Browse files
authored
fix typos in sync.md (quii#728)
1 parent c4a16c9 commit 2f2cc2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sync.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We want to make a counter which is safe to use concurrently.
66

77
We'll start with an unsafe counter and verify its behaviour works in a single-threaded environment.
88

9-
Then we'll exercise it's unsafeness, with multiple goroutines trying to use the counter via a test, and fix it.
9+
Then we'll exercise its unsafeness, with multiple goroutines trying to use the counter via a test, and fix it.
1010

1111
## Write the test first
1212

@@ -204,7 +204,7 @@ func (c *Counter) Inc() {
204204

205205
This _looks_ nice but while programming is a hugely subjective discipline, this is **bad and wrong**.
206206

207-
Sometimes people forget that embedding types means the methods of that type becomes _part of the public interface_; and you often will not want that. Remember that we should be very careful with our public APIs, the moment we make something public is the moment other code can couple themselves to it. We always want to avoid unnecessary coupling.
207+
Sometimes people forget that embedding types means the methods of that type become _part of the public interface_; and you often will not want that. Remember that we should be very careful with our public APIs, the moment we make something public is the moment other code can couple themselves to it. We always want to avoid unnecessary coupling.
208208

209209
Exposing `Lock` and `Unlock` is at best confusing but at worst potentially very harmful to your software if callers of your type start calling these methods.
210210

0 commit comments

Comments
 (0)