<commit_before>package gotest

import (
	"strings"
	"time"

	"github.com/jstemmer/go-junit-report/v2/gtr"
	"github.com/jstemmer/go-junit-report/v2/parser/gotest/internal/collector"
)

const (
	globalID = 0
)

// reportBuilder helps build a test Report from a collection of events.
//
// The reportBuilder keeps track of the active context whenever a test or build
// error is created. This is necessary because the test parser do not contain
// any state themselves and simply just emit an event for every line that is
// read. By tracking the active context, any output that is appended to the
// reportBuilder gets attributed to the correct test or build error.
type reportBuilder struct {
	packages    []gtr.Package
	tests       map[int]gtr.Test
	buildErrors map[int]gtr.Error
	runErrors   map[int]gtr.Error

	// state
	nextID    int               // next free unused id
	lastID    int               // most recently created id
	output    *collector.Output // output collected for each id
	coverage  float64           // coverage percentage
	parentIDs map[int]struct{}  // set of test id's that contain subtests

	// options
	packageName   string
	subtestMode   SubtestMode
	timestampFunc func() time.Time
}

// newReportBuilder creates a new reportBuilder.
func newReportBuilder() *reportBuilder {
	return &reportBuilder{
		tests:         make(map[int]gtr.Test),
		buildErrors:   make(map[int]gtr.Error),
		runErrors:     make(map[int]gtr.Error),<commit_msg>parser/gotest: Remove unused runErrors field from reportBuilder<commit_after>package gotest

import (
	"strings"
	"time"

	"github.com/jstemmer/go-junit-report/v2/gtr"
	"github.com/jstemmer/go-junit-report/v2/parser/gotest/internal/collector"
)

const (
	globalID = 0
)

// reportBuilder helps build a test Report from a collection of events.
//
// The reportBuilder keeps track of the active context whenever a test or build
// error is created. This is necessary because the test parser do not contain
// any state themselves and simply just emit an event for every line that is
// read. By tracking the active context, any output that is appended to the
// reportBuilder gets attributed to the correct test or build error.
type reportBuilder struct {
	packages    []gtr.Package
	tests       map[int]gtr.Test
	buildErrors map[int]gtr.Error

	// state
	nextID    int               // next free unused id
	lastID    int               // most recently created id
	output    *collector.Output // output collected for each id
	coverage  float64           // coverage percentage
	parentIDs map[int]struct{}  // set of test id's that contain subtests

	// options
	packageName   string
	subtestMode   SubtestMode
	timestampFunc func() time.Time
}

// newReportBuilder creates a new reportBuilder.
func newReportBuilder() *reportBuilder {
	return &reportBuilder{
		tests:         make(map[int]gtr.Test),
		buildErrors:   make(map[int]gtr.Error),
{'fraction_non_alphanumeric': 0.07997242330230955, 'fraction_numerical': 0.003447087211306446, 'mean_word_length': 3.2364963503649635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1055653', 'n_tokens_mistral': 856, 'n_tokens_neox': 818, 'n_words': 305}