Skip to content

Commit

Permalink
Merge pull request #1515 from lilijreey/use_time_IsZero
Browse files Browse the repository at this point in the history
improved code more clean use time.IsZero() replace t = time.Time{}
  • Loading branch information
Arthur Silva Sens authored May 15, 2024
2 parents c7c7509 + 47b807e commit cb57abb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prometheus/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cb57abb

Please sign in to comment.