A Tour of Go Variables with initializers

时间:2014-10-26 20:57:27   收藏:0   阅读:158

A var declaration can include initializers, one per variable.

If an initializer is present, the type can be omitted; the variable will take the type of the initializer.

package main 

import "fmt"

var i, j int = 1,3
var c, python, java = true, false, "no!"

func main() {
    fmt.Println(i, j, c, python, java)
}

 

原文:http://www.cnblogs.com/ghgyj/p/4052618.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!