Question #135

Author: admin
tags: Go  
package main

import "fmt"

type Game struct {
	year  int
	title string
}

func (g Game) ChangeYear() {
	g.year = 1993
}

func main() {
	game1 := Game{1992, "Doom 2"}
	game1.ChangeYear()

	fmt.Println(game1)
}
What will be printed?
{1992 Doom 2}
{1992 Doom 3}
Nothing, there will be an error
ChangeYear is a method with a value receiver, not a pointer receiver.
So this method works with a copy of the struct.
Rate the difficulty of the question:
easyhard