learning about golang variables

This commit is contained in:
Fabio Montefuscolo 2024-03-11 17:30:09 +01:00
parent 71915cf8f2
commit 772a43c21e
Signed by: fabiomontefuscolo
GPG key ID: B98DA1C6A4DE48B5

26
src/03-variables.go Normal file
View file

@ -0,0 +1,26 @@
package main
import "fmt"
func main() {
var a = "initial"
fmt.Println(a)
a = "changed"
fmt.Println(a)
var b, c int = 1, 2
fmt.Println("b=", b, ", c=", c)
var d = true
fmt.Println(d)
var e int
fmt.Println(e)
f := "short"
fmt.Println(f)
f = "changed short"
fmt.Println(f)
}