mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-04 21:12:53 -05:00
Revert "internal: make timestampFunc private"
This reverts commit dcbbd9fb22
and fixes
testdata/generate-golden-reports.go.
This commit is contained in:
@ -26,12 +26,10 @@ type Config struct {
|
||||
SkipXMLHeader bool
|
||||
SubtestMode gotest.SubtestMode
|
||||
Properties map[string]string
|
||||
TimestampFunc func() time.Time
|
||||
|
||||
// For debugging
|
||||
PrintEvents bool
|
||||
|
||||
// For testing
|
||||
timestampFunc func() time.Time
|
||||
}
|
||||
|
||||
// Run runs the go-junit-report command and returns the generated report.
|
||||
@ -98,6 +96,6 @@ func (c Config) gotestOptions() []gotest.Option {
|
||||
return []gotest.Option{
|
||||
gotest.PackageName(c.PackageName),
|
||||
gotest.SetSubtestMode(c.SubtestMode),
|
||||
gotest.TimestampFunc(c.timestampFunc),
|
||||
gotest.TimestampFunc(c.TimestampFunc),
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ func testRun(inputFile, reportFile string, config Config, t *testing.T) {
|
||||
}
|
||||
config.Hostname = "hostname"
|
||||
config.Properties = map[string]string{"go.version": "1.0"}
|
||||
config.timestampFunc = func() time.Time {
|
||||
config.TimestampFunc = func() time.Time {
|
||||
return time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user