Skip to content

Commit cb57abb

Browse files
author
Arthur Silva Sens
authored
Merge pull request #1515 from lilijreey/use_time_IsZero
improved code more clean use time.IsZero() replace t = time.Time{}
2 parents c7c7509 + 47b807e commit cb57abb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prometheus/metric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) {
234234
)
235235
for i, e := range exemplars {
236236
ts := e.Timestamp
237-
if ts == (time.Time{}) {
237+
if ts.IsZero() {
238238
ts = now
239239
}
240240
exs[i], err = newExemplar(e.Value, ts, e.Labels)

0 commit comments

Comments
 (0)