来源:https://github.com/xg-wang/gobyexample/tree/master/examples
package main
import "fmt"
func main() {
//`x := val` is shorthand for `var x type = val`.
//此种写法只能在函数体内有效
x := "Hello war"
fmt.Println(x)
}
输出结果:
Hello war
来源:https://github.com/xg-wang/gobyexample/tree/master/examples
package main
import "fmt"
func main() {
//`x := val` is shorthand for `var x type = val`.
//此种写法只能在函数体内有效
x := "Hello war"
fmt.Println(x)
}
输出结果:
Hello war
本文标题:gobyexample-short-declarations
本文链接:https://www.haomeiwen.com/subject/vehuxqtx.html
网友评论