Answers for "init method for struct in golang"

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 "init method for struct in golang"

Browse Popular Code Answers by Language