mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
fix: format dates in log in a portable way (#735)
The output of time.String() depends on the runtime environment and should only be used for debugging. This commit ensures that a well-defined UTC time is written to the report.
This commit is contained in:
1 parent
98d5648f6e
commit
106897fdf0
2 files changed
+5
-2
No files matched your search
+2
-1
@@ -3,6 +3,7 @@ package detect
|
||||
import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/gitleaks/go-gitdiff/gitdiff"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -70,7 +71,7 @@ func FromGit(files <-chan *gitdiff.File, cfg config.Config, outputOptions Option
|
||||
fi.Author = f.PatchHeader.Author.Name
|
||||
fi.Email = f.PatchHeader.Author.Email
|
||||
}
|
||||
fi.Date = f.PatchHeader.AuthorDate.String()
|
||||
fi.Date = f.PatchHeader.AuthorDate.UTC().Format(time.RFC3339)
|
||||
}
|
||||
|
||||
if outputOptions.Redact {
|
||||
|
||||
Reference in new issue
Block a user