美文网首页
gobyexample-short-declarations

gobyexample-short-declarations

作者: bocsoft | 来源:发表于2018-11-06 14:02 被阅读0次

来源: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