运行结果:
GOROOT=E:\Go #gosetup
GOPATH=H:\Go\src;H:\Go #gosetup
E:\Go\bin\go.exe build -o C:\Users\cleargo\AppData\Local\Temp\___go_build_test_go.exe H:/Go/test.go #gosetup
C:\Users\cleargo\AppData\Local\Temp\___go_build_test_go.exe #gosetup
最大值是:20
Process finished with exit code 0
函数返回多个值:
运行结果:
GOROOT=E:\Go #gosetup
GOPATH=H:\Go\src;H:\Go #gosetup
E:\Go\bin\go.exe build -o C:\Users\cleargo\AppData\Local\Temp\___go_build_test1_go.exe H:/Go/test1.go #gosetup
C:\Users\cleargo\AppData\Local\Temp\___go_build_test1_go.exe #gosetup
caijunjie zhenqi
全局、局部变量:
运行结果:
GOROOT=E:\Go #gosetup
GOPATH=H:\Go\src;H:\Go #gosetup
E:\Go\bin\go.exe build -o C:\Users\cleargo\AppData\Local\Temp\___go_build_test1_go.exe H:/Go/test1.go #gosetup
C:\Users\cleargo\AppData\Local\Temp\___go_build_test1_go.exe #gosetup
i的值为:90
形式参数:
GOROOT=E:\Go #gosetup
GOPATH=H:\Go\src;H:\Go #gosetup
E:\Go\bin\go.exe build -o C:\Users\cleargo\AppData\Local\Temp\___go_build_test2_go.exe H:/Go/test2.go #gosetup
C:\Users\cleargo\AppData\Local\Temp\___go_build_test2_go.exe #gosetup
main函数中:a=20
sum函数中:a=20
sum函数中:b=12
main函数中:c=32