Bo☆Be☆Ro☆Ku nth decoction
sample.go
//Declaration, assignment
var s string
s = "string"
//Type declaration and assignment together
var s string = "string"
//Type omitted
var s = "string"
//var omitted
s := "string"
//Multiple declarations of the same type
var s1, s2 string
s1, s2 = "s1", "s2"
//Substituting the same value is NG
s1, s2 = "s"
//Multiple assignments of the same type
s1, s2 := "s1", "s2"
//Separate type multiple declaration
var (
i int
s string
)
//Multiple assignments of different types
var (
i = 1
s = "s"
)
Recommended Posts