update book code

This commit is contained in:
Unknwon
2015-03-03 12:25:25 -05:00
parent b8c82ba4e5
commit eab1d98ba8
465 changed files with 15392 additions and 1572 deletions

34
eBook/exercises/chapter_4/function_calls_function.go Normal file → Executable file
View File

@@ -1,18 +1,18 @@
package main
var a string // global scope
func main() {
a = "G"
print(a)
f1()
}
func f1() {
a := "O" // new local variable a, only scoped within f1() !
print(a)
f2()
}
func f2() {
print(a) // global variable is taken
}
package main
var a string // global scope
func main() {
a = "G"
print(a)
f1()
}
func f1() {
a := "O" // new local variable a, only scoped within f1() !
print(a)
f2()
}
func f2() {
print(a) // global variable is taken
}
// GOG