Working with composite literals

Which of the following intializations will throw an error in Go?

1. a := […]string {Enone: “no error”, Eio: “Eio”, Einval: “invalid argument”}

2. m := map[int]string{Enone: “no error”, Eio: “Eio”, Einval: “invalid argument”}

Options
  1. Only 1
  2. Only 2
  3. Both 1 and 2
  4. Neither 1 nor 2

Related Posts