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: progress_report.go
    path of file: ./repos/kubernetes/vendor/github.com/onsi/ginkgo/v2/internal
    
    the code of the file until where you have to start completion: package internal

import (
	"bufio"
	"bytes"
	"context"
	"fmt"
	"io"
	"os"
	"os/signal"
	"path/filepath"
	"runtime"
	"strconv"
	"strings"
	"time"

	"github.com/onsi/ginkgo/v2/types"
)

var _SOURCE_CACHE = map[string][]string{}

type ProgressSignalRegistrar func(func()) context.CancelFunc

func RegisterForProgressSignal(handler func()) context.CancelFunc {
	signalChannel := make(chan os.Signal, 1)
	if len(PROGRESS_SIGNALS) > 0 {
		signal.Notify(signalChannel, PROGRESS_SIGNALS...)
	}
	ctx, cancel := context.WithCancel(context.Background())
	go func() {
		for {
			select {
			case <-signalChannel:
				handler()
			case <-ctx.Done():
				signal.Stop(
    
func fetchSource(filename string, lineNumber int, span int, configuredSourceRoots []string) ([]string, int) {
	if filename == "" {
		return []string{}, 0
	}

	var lines []string
	var ok bool
	if lines, ok = _SOURCE_CACHE[filename]; !ok {
		sourceRoots := []string{""}
		sourceRoots = append(sourceRoots, configuredSourceRoots...)
		var data []byte
		var err error
		var found bool
		for _, root := range sourceRoots {
			data, err = os.ReadFile(filepath.Join(root, filename))
			if err == nil {
				found = true
				break
			}
		}
		if !found {
			return []string{}, 0
		}
		lines = strings.Split(string(data), "\n")
		_SOURCE_CACHE[filename] = lines
	}

	startIndex := lineNumber - span - 1
	endIndex := startIndex + span + span + 1
	if startIndex < 0 {
		startIndex = 0
	}
	if endIndex > len(lines) {
		endIndex = len(lines)
	}
	highlightIndex := lineNumber - 1 - startIndex
	return lines[startIndex:endIndex], highlightIndex
}