Skip to content

Commit

Permalink
Update coding-style-guide.md (#2520)
Browse files Browse the repository at this point in the history
make `doSomething` a function call.

Signed-off-by: Halil Kaskavalci <halil@kaskavalci.com>
  • Loading branch information
kaskavalci committed Apr 24, 2020
1 parent 5b64108 commit 8af5266
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/contributing/coding-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ And what's broken is tiny `:` or lack of it.
This is also why we recommend to scope errors if you can:
```go
if err := doSomething; err != nil {
if err := doSomething(); err != nil {
// handle err
}
```
Expand Down Expand Up @@ -491,7 +491,7 @@ more readable to inline those few lines directly on the caller side.
}

func (s *myStruct) doSomethingAndHandleError() {
if err := doSomething; err != nil {
if err := doSomething(); err != nil {
level.Error(s.logger).Log("msg" "failed to do something; sorry", "err", err)
}
}
Expand All @@ -504,7 +504,7 @@ func (s *myStruct) doSomethingAndHandleError() {

```go
// Some code...
if err := doSomething; err != nil {
if err := doSomething(); err != nil {
level.Error(s.logger).Log("msg" "failed to do something; sorry", "err", err)
}

Expand Down

0 comments on commit 8af5266

Please sign in to comment.