IF-ELSE loop with return statement

What does “return” mean in the “if-else” loop in Golang?

  1. if is a conditional construct and not a loop.
  2. It is not special, a return in an if statement will do the same as one outside of an if statement. It will return zero to many values from the current function to its caller.
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.