Answers for "golang create and init struct"

Go
0

init struct go

type Student struct {
    Name string
    Age  int
}

var a Student    // a == Student{"", 0}
a.Name = "Alice" // a == Student{"Alice", 0}
Posted by: Guest on December-19-2020

Code answers related to "golang create and init struct"

Browse Popular Code Answers by Language