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: report_text.go
    path of file: ./repos/sliver/vendor/github.com/google/go-cmp/cmp
    
    the code of the file until where you have to start completion: // Copyright 2019, The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cmp

import (
	"bytes"
	"fmt"
	"math/rand"
	"strings"
	"time"
	"unicode/utf8"

	"github.com/google/go-cmp/cmp/internal/flags"
)

var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0

const maxColumnLength = 80

type indentMode int

func (n indentMode) appendIndent(b []byte, d diffMode) []byte {
	// The output of Diff is documented as being unstable to provide future
	// flexibility in changing the output for more humanly readable reports.
	// This logic intentionally introduces instability to the exact output
	// so that users can detect accidental reliance on stability early on,
	// rather than much later when an actual change to the format occurs.
	if flags.Deterministic || randBool {
		// Use regular spaces (U+0020).
		switch d {
		case diffUnknown, diffIdentical:
			b = append(b, "  "...)
		case diffRemoved:
			b = append(b, "- "...)
		case diffInserted:
			b = append(b, "+ "...)
		}
	} else {
		// Use non-breaking spaces (U+00a0).
		switch d {
		case diffUnknown, diffIdentical:
			b = append(b, "  "...)
		case diffRemoved:
			b = append(b, "- "...)
		case diffInserted:
			b = append(b, "+ "...)
		}
	}
	return repeatCount(n).appendChar(b, '\t')
}

type repeatCount int

func (n repeatCount) appendChar(b [
    
func (s textList) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte {
	alignKeyLens := s.alignLens(
		func(r textRecord) bool {
			_, isLine := r.Value.(textLine)
			return r.Key == "" || !isLine
		},
		func(r textRecord) int { return utf8.RuneCountInString(r.Key) },
	)
	alignValueLens := s.alignLens(
		func(r textRecord) bool {
			_, isLine := r.Value.(textLine)
			return !isLine || r.Value.Equal(textEllipsis) || r.Comment == nil
		},
		func(r textRecord) int { return utf8.RuneCount(r.Value.(textLine)) },
	)

	// Format lists of simple lists in a batched form.
	// If the list is sequence of only textLine values,
	// then batch multiple values on a single line.
	var isSimple bool
	for _, r := range s {
		_, isLine := r.Value.(textLine)
		isSimple = r.Diff == 0 && r.Key == "" && isLine && r.Comment == nil
		if !isSimple {
			break
		}
	}
	if isSimple {
		n++
		var batch []byte
		emitBatch := func() {
			if len(batch) > 0 {
				b = n.appendIndent(append(b, '\n'), d)
				b = append(b, bytes.TrimRight(batch, " ")...)
				batch = batch[:0]
			}
		}
		for _, r := range s {
			line := r.Value.(textLine)
			if len(batch)+len(line)+len(", ") > maxColumnLength {
				emitBatch()
			}
			batch = append(batch, line...)
			batch = append(batch, ", "...)
		}
		emitBatch()
		n--
		return n.appendIndent(append(b, '\n'), d)
	}

	// Format the list as a multi-lined output.
	n++
	for i, r := range s {
		b = n.appendIndent(append(b, '\n'), d|r.Diff)
		if r.Key != "" {
			b = append(b, r.Key+": "...)
		}
		b = alignKeyLens[i].appendChar(b, ' ')

		b = r.Value.formatExpandedTo(b, d|r.Diff, n)
		if !r.ElideComma {
			b = append(b, ',')
		}
		b = alignValueLens[i].appendChar(b, ' ')

		if r.Comment != nil {
			b = append(b, " // "+r.Comment.String()...)
		}
	}
	n--

	return n.appendIndent(append(b, '\n'), d)
}