golang and operator code example

Example 1: go variable default

Variables declared without an explicit initial value are given their zero value.

The zero value is:

0 for numeric types,
false for the boolean type, and
"" (the empty string) for strings.

Example 2: go operators

+	addition
-	subtraction
*	multiplication
/	quotient
%	remainder
&	bitwise and
|	bitwise or
^	bitwise xor
&^	bit clear (and not)
<<	left shift
>>	right shift

Example 3: go logical operators

&&	logical and
||	logical or
!	logical not

Tags:

Go Example