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: go_git.go
    path of file: ./repos/devspace/pkg/util/git
    
    the code of the file until where you have to start completion: package git

import (
	"fmt"
	"os"

	"github.com/pkg/errors"
	git "gopkg.in/src-d/go-git.v4"
	plumbing "gopkg.in/src-d/go-git.v4/plumbing"
)

// GoGitRepository holds the information about a repository
type GoGitRepository struct {
	LocalPath strin
    
func (gr *GoGitRepository) Update(merge bool) error {
	// Check if repo already exists
	_, err := os.Stat(gr.LocalPath + "/.git")
	if err != nil {
		// Create local path
		err := os.MkdirAll(gr.LocalPath, 0755)
		if err != nil {
			return err
		}

		// Check
		// Clone into folder
		_, err = git.PlainClone(gr.LocalPath, false, &git.CloneOptions{
			URL: gr.RemoteURL,
		})
		if err != nil {
			return err
		}

		return nil
	}

	// Open existing repo
	repo, err := git.PlainOpen(gr.LocalPath)
	if err != nil {
		return err
	}

	// Pull or fetch?
	if merge {
		repoWorktree, err := repo.Worktree()
		if err != nil {
			return err
		}

		// Make sure main is checked out
		err = repoWorktree.Checkout(&git.CheckoutOptions{
			Branch: plumbing.ReferenceName("refs/heads/main"),
			Create: false,
		})
		if err != nil {
			return err
		}

		err = repoWorktree.Pull(&git.PullOptions{
			RemoteName: "origin",
		})
		if err != git.NoErrAlreadyUpToDate && err != nil {
			return err
		}
	} else {
		err = repo.Fetch(&git.FetchOptions{
			RemoteName: "origin",
		})
		if err != git.NoErrAlreadyUpToDate && err != nil {
			return err
		}
	}

	return nil
}