parser/gotest: timestampFunc should always be set, skip nil check

This commit is contained in:
Joël Stemmer 2022-08-13 21:59:50 +01:00
parent 1c826cb28d
commit 4ce910564c

View File

@ -187,12 +187,9 @@ func (b *reportBuilder) CreateBuildError(packageName string) {
// so far. Afterwards all state is reset. // so far. Afterwards all state is reset.
func (b *reportBuilder) CreatePackage(name, result string, duration time.Duration, data string) { func (b *reportBuilder) CreatePackage(name, result string, duration time.Duration, data string) {
pkg := gtr.Package{ pkg := gtr.Package{
Name: name, Name: name,
Duration: duration, Duration: duration,
} Timestamp: b.timestampFunc(),
if b.timestampFunc != nil {
pkg.Timestamp = b.timestampFunc()
} }
// Build errors are treated somewhat differently. Rather than having a // Build errors are treated somewhat differently. Rather than having a