Go basics

Functions

A basic function that prints a string

import "fmt"

func main() {
    fmt.Println("Hello world")
}

Variables

Initial variable assignment

var greeting string = "Hello!" // Long variable assignment
greeting := "Hello!" // Short variable assignment

Changing variables

greeting = "Hey!"

Author: Matei Cotocel

Created: 2021-11-13 Sat 19:40

Validate