Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
teivah committed Oct 6, 2024
2 parents a2ae188 + 2cbe091 commit 8d85d6c
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 140 deletions.
2 changes: 1 addition & 1 deletion docs/5-interface-pollution.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Custom implementations of `io.Writer` should write the data coming from a slice

What is the rationale for having these two interfaces in the language? What is the point of creating these abstractions?

Let’s assume we need to implement a function that should copy the content of one file to another. We could create a specific function that would take as input two `*os.Files`. Or, we can choose to create a more generic function using `io.Reader` and `io.Writer` abstractions:
Let’s assume we need to implement a function that should copy the content of one file to another. We could create a specific function that would take as input two `*os.File`. Or, we can choose to create a more generic function using `io.Reader` and `io.Writer` abstractions:

```go
func copySourceToDest(source io.Reader, dest io.Writer) error {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2215,7 +2215,7 @@ func main() {
}
```

Runnig this code with the `-race` logs the following warning:
Running this code with the `-race` logs the following warning:

```bash hl_lines="3 7 11"
==================
Expand Down
262 changes: 131 additions & 131 deletions docs/zh.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/teivah/100-go-mistakes

go 1.18

require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/teivah/100-go-mistakes/02-code-project-organization/3-init-functions/redis"
"github.com/teivah/100-go-mistakes/src/02-code-project-organization/3-init-functions/redis"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

import "github.com/teivah/100-go-mistakes/02-code-project-organization/6-interface-producer/store"
import "github.com/teivah/100-go-mistakes/src/02-code-project-organization/6-interface-producer/store"

type customersGetter interface {
GetAllCustomers() ([]store.Customer, error)
Expand Down
2 changes: 1 addition & 1 deletion src/08-concurrency-foundations/60-contexts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"time"

"github.com/teivah/100-go-mistakes/08-concurrency-foundations/60-contexts/flight"
"github.com/teivah/100-go-mistakes/src/08-concurrency-foundations/60-contexts/flight"
)

type publisher interface {
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package counter_test
import (
"testing"

counter "github.com/teivah/100-go-mistakes/11-testing/90-testing-features/different-package"
counter "github.com/teivah/100-go-mistakes/src/11-testing/90-testing-features/different-package"
)

func TestCount(t *testing.T) {
Expand Down

0 comments on commit 8d85d6c

Please sign in to comment.