You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: date.go
    path of file: ./repos/learning/golang/source_code/head-first-go-code/ch10/go/src/github.com/headfirstgo/calendar
    
    the code of the file until where you have to start completion: package calendar

import "errors"

type Date struct {
	year  int

    
func (d *Date) SetDay(day int) error {
	if day < 1 || day > 31 {
		return errors.New("invalid day")
	}
	d.day = day
	return nil
}