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: project_view.go
    path of file: ./repos/glab/commands/project/view
    
    the code of the file until where you have to start completion: package view

import (
	"encoding/base64"
	"fmt"
	"strings"

	"github.com/MakeNowJust/heredoc"
	"github.com/profclems/glab/api"
	"github.com/profclems/glab/commands/cmdutils"
	"github.com/profclems/glab/internal/glrepo"
	"github.com/profclems/glab/pkg/iostreams"
	"github.com/profclems/glab/pkg/utils"
	"github.com/spf13/cobra"
	"github.com/xanzy/go-gitlab"
)

type ViewOptions struct {
	ProjectID    string
	APIClient    *gitlab.Client
	Web          bool
	Branch       string
	Browser      string
	GlamourStyle string

	IO   *iostreams.IOStreams
	Repo glrepo.Interface
}

func NewCmdView(f *cmdutils.Factory) *cobra.Command {
	opts := ViewOptions{
		IO: f.IO,
	}

	var projectViewCmd = &cobra.Command{
		Use:   "view [repository] [flags]",
		Short: "View a project/repository",
		Long:  `Display the description and README of a project or open it in the browser.`,
		Args:  cobra.Maximu
    
func NewCmdView(f *cmdutils.Factory) *cobra.Command {
	opts := ViewOptions{
		IO: f.IO,
	}

	var projectViewCmd = &cobra.Command{
		Use:   "view [repository] [flags]",
		Short: "View a project/repository",
		Long:  `Display the description and README of a project or open it in the browser.`,
		Args:  cobra.MaximumNArgs(1),
		Example: heredoc.Doc(`
			# view project information for the current directory
			$ glab repo view

			# view project information of specified name
			$ glab repo view my-project
			$ glab repo view user/repo
			$ glab repo view group/namespace/repo

			# specify repo by full [git] URL
			$ glab repo view git@gitlab.com:user/repo.git
			$ glab repo view https://gitlab.company.org/user/repo
			$ glab repo view https://gitlab.company.org/user/repo.git
		`),
		RunE: func(cmd *cobra.Command, args []string) error {
			var err error

			cfg, err := f.Config()
			if err != nil {
				return err
			}

			opts.Branch = strings.TrimSpace(opts.Branch)

			if len(args) == 1 {
				opts.ProjectID = args[0]
			}

			apiClient, err := f.HttpClient()
			if err != nil {
				return err
			}
			opts.APIClient = apiClient

			if opts.ProjectID == "" {
				opts.Repo, err = f.BaseRepo()
				if err != nil {
					return cmdutils.WrapError(err, "`repository` is required when not running in a git repository")
				}
				opts.ProjectID = opts.Repo.FullName()

				if opts.Branch == "" {
					opts.Branch, _ = f.Branch()
				}
			}

			if opts.ProjectID != "" {
				if !strings.Contains(opts.ProjectID, "/") {
					currentUser, err := api.CurrentUser(opts.APIClient)
					if err != nil {
						return cmdutils.WrapError(err, "Failed to retrieve your current user")
					}

					opts.ProjectID = currentUser.Username + "/" + opts.ProjectID
				}

				repo, err := glrepo.FromFullName(opts.ProjectID)
				if err != nil {
					return err
				}

				if !glrepo.IsSame(repo, opts.Repo) {
					client, err := api.NewClientWithCfg(repo.RepoHost(), cfg, false)
					if err != nil {
						return err
					}
					opts.APIClient = client.Lab()
				}
				opts.Repo = repo
				opts.ProjectID = repo.FullName()
			}

			browser, _ := cfg.Get(opts.Repo.RepoHost(), "browser")
			opts.Browser = browser

			opts.GlamourStyle, _ = cfg.Get(opts.Repo.RepoHost(), "glamour_style")

			return runViewProject(&opts)
		},
	}

	projectViewCmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open a project in the browser")
	projectViewCmd.Flags().StringVarP(&opts.Branch, "branch", "b", "", "View a specific branch of the repository")

	return projectViewCmd
}