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: generator.go
    path of file: ./repos/go-is-not-good
    
    the code of the file until where you have to start completion: package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"sort"
	"text/template"
)

type Entry struct {
	URL        string
	Author     string
	Year       in
    
func copyContents(origin string, target *os.File) error {
	f, err := os.Open(origin)
	if err != nil {
		fmt.Println("Error opening "+origin+":", err)
		os.Exit(1)
	}
	defer f.Close()

	contents, err := ioutil.ReadAll(f)
	if err != nil {
		return err
	}

	_, err = target.Write(contents)
	if err != nil {
		return err
	}

	return nil
}