Skip to content

Commit

Permalink
Merge pull request #98 from aermolaev/patch-1
Browse files Browse the repository at this point in the history
Update 5-interface-pollution.md: typo fixed
  • Loading branch information
teivah authored Aug 13, 2024
2 parents 1074108 + 7a701f4 commit 22ac4b3
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 22ac4b3

Please sign in to comment.