Learnmonkey Learnmonkey Logo

Go Operators

What are Operators?

Operators are used to perform operations on variables and values. For example, the + operators adds together numbers:


package main
import "fmt"

func main () {
    var a = 15
    var b = 5
    fmt.Println(a + b)
    fmt.Println(5 + 6)
}
    

The output of the code is:


20
11
    

Types of Operators

Go divides operators into the following types: