Operators in Go
Golang Concepts
Go: Operators
We have written down different types of Operators in golang arithmatic operator, comparison operator, logical operator ant Other operators.
Arithmetic Operators in Go
Operator | Description |
---|---|
+ | addition |
- | subtraction |
* | multiplication |
/ | quotient |
% | remainder |
& | bitwise and |
| | bitwise or |
^ | bitwise xor |
&^ | bit clear (and not) |
<< | left shift |
>> | right shift |
Comparison Operators in Go
Operator | Description |
---|---|
== | equal |
!= | not equal |
< | less than |
<= | less than or equal |
> | greater than |
>= | greater than or equal |
Logical Operators in Go
Operator | Description |
---|---|
&& | logical and |
|| | logical or |
! | logical not |
Other Operators in Go
Operator | Description |
---|---|
& | address of / create pointer |
* | dereference pointer |
<- | send / receive operator (see 'Channels' below) |