From 7d73a1b322d6725a5c462a98e6115eb1a0159021 Mon Sep 17 00:00:00 2001 From: Halil Kaskavalci Date: Fri, 24 Apr 2020 11:46:03 +0200 Subject: [PATCH] Update coding-style-guide.md make `doSomething` a function call. Signed-off-by: Halil Kaskavalci --- docs/contributing/coding-style-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing/coding-style-guide.md b/docs/contributing/coding-style-guide.md index a99192ca6c..5483023e49 100644 --- a/docs/contributing/coding-style-guide.md +++ b/docs/contributing/coding-style-guide.md @@ -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 } ``` @@ -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) } } @@ -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) }