Question #250

Author: admin
tags: Go  
package main

import (
	"fmt"
)

type Planet struct {
	name string
}

type Person struct {
	legsAmount int
	friendsIds []int
	planet     Planet
}

func main() {
	person1 := Person{
		legsAmount: 5,
		friendsIds: []int{920, 950},
		planet:     Planet{name: "Mars"},
	}

	person2 := person1

	person2.legsAmount = 10
	person2.friendsIds[0] = 622
	person2.planet.name = "Venus"

	fmt.Printf("%#v\n", person1) // ??
}
What will be printed?
main.Person{legsAmount:5, friendsIds:[]int{622, 950}, planet:main.Planet{name:"Venus"}}
main.Person{legsAmount:5, friendsIds:[]int{622, 950}, planet:main.Planet{name:"Mars"}}
main.Person{legsAmount:5, friendsIds:[]int{920, 950}, planet:main.Planet{name:"Venus"}}
main.Person{legsAmount:5, friendsIds:[]int{920, 950}, planet:main.Planet{name:"Mars"}}
main.Person{legsAmount:10, friendsIds:[]int{622, 950}, planet:main.Planet{name:"Venus"}}
main.Person{legsAmount:10, friendsIds:[]int{622, 950}, planet:main.Planet{name:"Mars"}}
main.Person{legsAmount:10, friendsIds:[]int{920, 950}, planet:main.Planet{name:"Venus"}}
main.Person{legsAmount:10, friendsIds:[]int{920, 950}, planet:main.Planet{name:"Mars"}}
Rate the difficulty of the question:
easyhard