Browse Source

Merge pull request #2521 from elusivePorpoise/main

remove misleading defer if example
Jeroen van Rijn 2 years ago
parent
commit
118ab60588
1 changed files with 1 additions and 3 deletions
  1. 1 3
      examples/demo/demo.odin

+ 1 - 3
examples/demo/demo.odin

@@ -2145,10 +2145,8 @@ or_return_operator :: proc() {
 			return -345 * z, zerr
 		}
 
-		// If the other return values need to be set depending on what the end value is,
-		// the 'defer if' idiom is can be used
 		defer if err != nil {
-			n = -1
+			fmt.println("Error in", #procedure, ":" , err)
 		}
 
 		n = 123