Skip to content

Commit 47b807e

Browse files
committed
clean code use time.IsZero() replace t = time.Time{}, make code more readable
Signed-off-by: chuanshuo <[email protected]>
1 parent 853c5de commit 47b807e

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)