Complete the code to define a struct named Person.
type [1] struct {
Name string
Age int
}The struct name should start with a capital letter to be exported. Here, Person is the correct struct name.
Complete the code to create a variable of type Person.
var p [1]To create a variable of the struct type, use the struct's name Person.
Fix the error in the struct field definition.
type Car struct {
Brand [1]
Year int
}In Go, the correct type for text is string (all lowercase).
Fill both blanks to define a struct with two fields.
type Book struct {
Title [1]
Pages [2]
}The Title should be a string and Pages should be an int because pages are whole numbers.
Fill all three blanks to define a struct and create a variable of that struct.
type [1] struct { Name string Age [2] } var p [3]
The struct is named Person, Age is an int, and the variable p is of type Person.
