Skip to content

Commit

Permalink
Merge pull request #95 from kennethy/patch-1
Browse files Browse the repository at this point in the history
Add comments to indicate it's a bad/good example
  • Loading branch information
teivah committed Jul 17, 2024
2 parents 9990a8c + 43555f9 commit 1074108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/09-concurrency-practice/74-copying-sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
}

type Counter struct {
mu sync.Mutex
mu sync.Mutex // bad
counters map[string]int
}

Expand All @@ -38,7 +38,7 @@ func (c *Counter) Increment2(name string) {
}

type Counter2 struct {
mu *sync.Mutex
mu *sync.Mutex // good
counters map[string]int
}

Expand Down

0 comments on commit 1074108

Please sign in to comment.