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: ref_group_builder.go
    path of file: ./repos/git-sizer/internal/refopts
    
    the code of the file until where you have to start completion: package refopts

import (
	"fmt"
	"strings"

	"github.com/spf13/pflag"

	"github.com/github/git-sizer/git"
	"github.com/github/git-sizer/sizes"
)

// Configger is an abstraction for a thing that can read gitconfig.
type Configger interface {
	GetConfig(prefix string) (*git.Config, error)
}

// RefGroupBuilder handles reference-related options and puts together
// a `sizes.RefGrouper` to be used by the main part of the program.
type RefGroupBuilder struct {
	topLev
    
func (rgb *RefGroupBuilder) Finish(defaultAll bool) (sizes.RefGrouper, error) {
	if rgb.topLevelGroup.filter == nil {
		// User didn't specify any reference options.
		if defaultAll {
			rgb.topLevelGroup.filter = git.AllReferencesFilter
		} else {
			rgb.topLevelGroup.filter = git.NoReferencesFilter
		}
	}

	refGrouper := refGrouper{
		topLevelGroup: rgb.topLevelGroup,
	}

	if err := refGrouper.fillInTree(refGrouper.topLevelGroup); err != nil {
		return nil, err
	}

	if refGrouper.topLevelGroup.filter != nil {
		refGrouper.ignoredRefGroup = &sizes.RefGroup{
			Symbol: "ignored",
			Name:   "Ignored",
		}
		refGrouper.refGroups = append(refGrouper.refGroups, *refGrouper.ignoredRefGroup)
	}

	return &refGrouper, nil
}