Example:
if function1(input) && function2(input) {}
In this case would function2(input)
be executed if function1(input)
returns false?
Example:
if function1(input) && function2(input) {}
In this case would function2(input)
be executed if function1(input)
returns false?
What you are asking about is called Short Circuiting, and yes, Go does it.
In the language spec, it says that
Logical operators apply to boolean values and yield a result of the same type as the operands. The right operand is evaluated conditionally.
This means that, in your case, if function1
returned false, function2
would not be called.