diff --git a/examples/variables/variables.go b/examples/variables/variables.go index 8e0912f..5fa61d4 100644 --- a/examples/variables/variables.go +++ b/examples/variables/variables.go @@ -29,6 +29,7 @@ func main() { // The `:=` syntax is shorthand for declaring and // initializing a variable, e.g. for // `var f string = "apple"` in this case. + // This syntax is only available inside functions. f := "apple" fmt.Println(f) } diff --git a/examples/variables/variables.hash b/examples/variables/variables.hash index 040888b..2665b92 100644 --- a/examples/variables/variables.hash +++ b/examples/variables/variables.hash @@ -1,2 +1,2 @@ -736ce4018f275bb8d12e5232349bae93611506b2 -iYyAIilyBRf +9aeef52b289d7ad9b9ac79f129d4e49f956c60ef +N5rWndIliJW diff --git a/public/variables b/public/variables index 736c7c4..11c6fee 100644 --- a/public/variables +++ b/public/variables @@ -43,7 +43,7 @@ calls.

- +
package main
 
@@ -133,7 +133,8 @@ zero value for an int is 0.

The := syntax is shorthand for declaring and initializing a variable, e.g. for -var f string = "apple" in this case.

+var f string = "apple" in this case. +This syntax is only available inside functions.