From 19af62dcc80daed8fc87ef52afd3d869f56d23f5 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 15 Oct 2019 19:52:31 +0200 Subject: [PATCH] Use a cleaner initialization of `separatorByteSlice` The `const separatorByte` wasn't used anymore actually. In `vec.go`, we were using `model.SeparatorByte`, which is better anyway. So remove the unused constant and initialize `separatorByteSlice` with `model.SeparatorByte`, too. Signed-off-by: beorn7 --- prometheus/metric.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/prometheus/metric.go b/prometheus/metric.go index 5bb7f80..0df1eff 100644 --- a/prometheus/metric.go +++ b/prometheus/metric.go @@ -18,13 +18,12 @@ import ( "time" "github.com/golang/protobuf/proto" + "github.com/prometheus/common/model" dto "github.com/prometheus/client_model/go" ) -const separatorByte byte = 255 - -var separatorByteSlice = []byte{255} // For convenient use with xxhash. +var separatorByteSlice = []byte{model.SeparatorByte} // For convenient use with xxhash. // A Metric models a single sample value with its meta data being exported to // Prometheus. Implementations of Metric in this package are Gauge, Counter,