Download
26 lines 541 BTomoModified 2025-11-29 raw
1234567891011121314151617181920212223242526
# Variables

func main()

    # Variable declarations use `:=` and do not
    # require you to specify a type explicitly:
    x := 123

    # To assign a new value, use `=`
    x = 999

    # You can also use update assignments like `+=`
    x += 1

    assert x == 1000

    # Variables are strongly typed, so you can't
    # assign different types to the same variable:
    x = "hello" # <-- This will error, comment it out or fix it

    # Declare a variable called `y` and give it the
    # value "okay"

    ???

    assert y == "okay"