Operators in Go

Go: Operators

We have written down different types of Operators in golang like arithmatic operator, comparison operator, logical operator ant Other operators.

Arithmetic Operators in Go

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

Comparison Operators in Go

OperatorDescription
==equal
!=not equal
<less than
<=less than or equal
>greater than
>=greater than or equal

Logical Operators in Go

OperatorDescription
&&logical and
||logical or
!logical not

Other Operators in Go

OperatorDescription
&address of / create pointer
*dereference pointer
<-send / receive operator (see 'Channels' below)

Conclusion

In this article, we walked through different types of operators in golang and their syntax and definition.

Previous Article