Answers for "when to use var in golang"

Go
1

golang set env var

// set env var "FOO" to value "1"
    os.Setenv("FOO", "1")
    // will print "FOO: 1"
    fmt.Println("FOO:", os.Getenv("FOO"))
Posted by: Guest on October-29-2020
0

variables in golang

var msg string
msg = "Hello"
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language