Skip to content

Instantly share code, notes, and snippets.

@Agilulfe
Created September 9, 2020 15:31
Show Gist options
  • Save Agilulfe/5596835a314423cc746c8a7426130dbe to your computer and use it in GitHub Desktop.
Save Agilulfe/5596835a314423cc746c8a7426130dbe to your computer and use it in GitHub Desktop.
Variables tutorial
package main
import "fmt"
var y = "Hello, Scope!"
func main() {
var x string
x = "Hello, World!"
fmt.Println(x)
const pi float64 = 3.1416
fmt.Println(pi)
var (
first = "I"
second = "love"
third = "Go."
)
fmt.Println(first, second, third)
fmt.Println(y)
testScope()
}
func testScope() {
fmt.Println(y, "test")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment