Merge pull request #1515 from lilijreey/use_time_IsZero

improved code more clean use time.IsZero() replace t = time.Time{}
This commit is contained in:
Arthur Silva Sens 2024-05-15 11:17:22 -03:00 committed by GitHub
commit cb57abb57d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) {
)
for i, e := range exemplars {
ts := e.Timestamp
if ts == (time.Time{}) {
if ts.IsZero() {
ts = now
}
exs[i], err = newExemplar(e.Value, ts, e.Labels)