Skip to content

Commit

Permalink
Merge pull request #21 from ParthoKR/patch-1
Browse files Browse the repository at this point in the history
Fixed some typos and grammatical errors
  • Loading branch information
bahlo authored Jan 20, 2021
2 parents 0c03ced + 5b53c34 commit d0c797a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (h *Handlers) DropHandler(w http.ResponseWriter, r *http.Request) {
```
Use structs to encapsulate the variables and make them available only to those functions that actually need them by making them methods implemented for that struct.

Alternatively higher-order functions can be used to inject dependencies via closures.
Alternatively, higher-order functions can be used to inject dependencies via closures.
```go
func main() {
db := // ...
Expand Down Expand Up @@ -316,11 +316,11 @@ func TestAdd(t *testing.T) {
}
```

Using table driven tests in combination with subtests gives you direct insight
Using table-driven tests in combination with subtests gives you direct insight
about which case is failing and which cases are tested.
[Mitchell Hashimoto at GopherCon 2017](https://youtu.be/8hQG7QlcLBk?t=7m34s)

Running subtests in parallel allows you to have a lot more test cases and still get those awesomely fast go build times.
Running subtests in parallel allow you to have a lot more test cases and still get those awesomely fast go build times.
[The Go Blog](https://blog.golang.org/subtests)

### Avoid mocks
Expand Down Expand Up @@ -561,7 +561,7 @@ Favour small interfaces and only expect the interfaces you need in your funcs.

## Don't under-package

Deleting or merging packages is far more easier than splitting big ones up.
Deleting or merging packages is far easier than splitting big ones up.
When unsure if a package can be split, do it.

## Handle signals
Expand Down Expand Up @@ -733,7 +733,7 @@ func someOtherHelper() string {
}
```

Putting `main()` first makes reading the file a lot more easier. Only the
Putting `main()` first makes reading the file a lot easier. Only the
`init()` function should be above it.

## Use internal packages
Expand Down Expand Up @@ -819,7 +819,7 @@ func startServer(opts ...ServerOpt) {

## Structs
### Use named structs
If a struct has more than one field include field names when instantiating it.
If a struct has more than one field, include field names when instantiating it.

**Don't:**
```go
Expand Down

0 comments on commit d0c797a

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy