Answers for "how to init a struct go"

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

Browse Popular Code Answers by Language