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: backup_fetch_handler.go
    path of file: ./repos/wal-g/internal/databases/greenplum
    
    the code of the file until where you have to start completion: package greenplum

import (
	"fmt"
	"path"
	"strings"

	"github.com/pkg/errors"

	"github.com/greenplum-db/gp-common-go-libs/cluster"
	"github.com/wal-g/tracelog"
	"github.com/wal-g/wal-g/internal"
	conf "github.com/wal-g/wal-g/internal/config"
	"github.com/wal-g/wal-g/pkg/storages/storage"
)

type BackupFetchMode string

c
    
func prepareContentIDsToFetch(fetchContentIds []int, segmentConfigs []cluster.SegConfig) map[int]bool {
	contentIDsToFetch := make(map[int]bool)

	// if user set the specific content IDs, use only them, otherwise fetch all
	if len(fetchContentIds) > 0 {
		for _, id := range fetchContentIds {
			contentIDsToFetch[id] = true
		}
	} else {
		for _, cfg := range segmentConfigs {
			contentIDsToFetch[cfg.ContentID] = true
		}
	}

	return contentIDsToFetch
}