Skip to content

Commit 148c1e7

Browse files
committed
run linter
Signed-off-by: Roy Chiang <[email protected]>
1 parent ca8cb9c commit 148c1e7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

pkg/util/metrics_helper.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7-
"github.com/golang/protobuf/proto"
87
"math"
98
"strings"
109
"sync"
1110

11+
"github.com/gogo/protobuf/proto"
12+
1213
"github.com/go-kit/log/level"
1314
"github.com/prometheus/client_golang/prometheus"
1415
dto "github.com/prometheus/client_model/go"
@@ -564,8 +565,8 @@ type UserRegistry struct {
564565
// UserRegistries holds Prometheus registries for multiple users, guaranteeing
565566
// multi-thread safety and stable ordering.
566567
type UserRegistries struct {
567-
regsMu sync.Mutex
568-
regs []UserRegistry
568+
regsMu sync.Mutex
569+
regs []UserRegistry
569570
removedMetrics MetricFamilyMap
570571
}
571572

@@ -714,7 +715,7 @@ func (r *UserRegistries) BuildMetricFamiliesPerUser() MetricFamiliesPerUser {
714715
}
715716
}
716717
data = append(data, struct {
717-
user string
718+
user string
718719
metrics MetricFamilyMap
719720
}{
720721
user: "", metrics: r.removedMetrics})
@@ -821,8 +822,8 @@ type CollectorVec interface {
821822
}
822823

823824
type MergedMetricFamily struct {
824-
metricFamily *dto.MetricFamily
825-
metricMap MetricMap
825+
metricFamily *dto.MetricFamily
826+
metricMap MetricMap
826827
}
827828

828829
func (m *MergedMetricFamily) CreateMetricFamily() *dto.MetricFamily {
@@ -877,7 +878,7 @@ func getMergeFunc(metricType dto.MetricType) (func(existing *dto.Metric, new *dt
877878
case dto.MetricType_HISTOGRAM:
878879
return mergeHistogram, nil
879880
default:
880-
return nil, errors.New(fmt.Sprintf("unknown metric type: %v", metricType))
881+
return nil, fmt.Errorf("unknown metric type: %v", metricType)
881882
}
882883
}
883884

@@ -919,12 +920,12 @@ func mergeSummary(mf1 *dto.Metric, mf2 *dto.Metric) {
919920

920921
type MetricMap struct {
921922
metrics map[string][]*Metric
922-
lock sync.Mutex
923+
lock sync.Mutex
923924
}
924925

925926
type Metric struct {
926-
metric dto.Metric
927-
lock sync.Mutex
927+
metric dto.Metric
928+
lock sync.Mutex
928929
}
929930

930931
func NewMetricMap() MetricMap {

0 commit comments

Comments
 (0)