Printing individual struct fields

Report a typo

Billie Joe has been trying to learn about Go structs but he's having a really hard time! Can you help him fix his code so that he can properly print every individual field of the greenDay struct of the Band type?

Write a program in Go
package main

import "fmt"

// do not change the name or the contents of the 'Band' struct!
type Band struct {
Name string
Members []string
Genre string
}

func main() {
// do not change the contents or the name of the 'greenDay' struct!
greenDay := Band{
Name: "Green Day",
Members: []string{"Billie Joe Armstrong", "Mike Dirnt", "Tré Cool"},
Genre: "Punk rock",
}

// print each one of the individual fields of the 'greenDay' struct here
fmt.Println(?.?)
fmt.Println(?.?)
fmt.Println(?.?)
}
___

Create a free account to access the full topic