Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(606)

Unified Diff: 2014/readability/if-else-good.go

Issue 176660043: code review 176660043: x/talks/2014/readability: talk for GoCon 2014 autumn in...
Patch Set: diff -r 05bdda42259e https://code.google.com/p/go.talks/ Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « 2014/readability/if-else-bad.go ('k') | 2014/readability/if-switch-bad.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 2014/readability/if-else-good.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/2014/readability/if-else-good.go
@@ -0,0 +1,11 @@
+package sample // OMIT
+
+func sample() { // OMIT
+
+ if _, found := f.dirs[dir]; found { // HL
+ f.addErr(fmt.Errorf("..."))
+ return
+ }
+ f.dirs[dir] = new(feedDir) // HL
+ // some code
+} // OMIT
« no previous file with comments | « 2014/readability/if-else-bad.go ('k') | 2014/readability/if-switch-bad.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b