Skip to content

Commit f382e5f

Browse files
committed
fix reserved words used as variable names
1 parent e6aa549 commit f382e5f

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

common/gera/map_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,18 @@ pdp_workflow_parameters: ""
250250
})
251251

252252
It("should correctly return a copy of the whole structure", func() {
253-
copy := stringMap.Copy()
254-
Expect(copy).NotTo(BeNil())
255-
Expect(copy == stringMap).NotTo(BeTrue())
256-
Expect(copy).To(Equal(stringMap))
257-
Expect(copy.Raw()).To(Equal(stringMap.Raw()))
258-
Expect(copy.Len()).To(Equal(stringMap.Len()))
259-
copy.Set("detector", "test")
260-
Expect(copy).NotTo(Equal(stringMap))
261-
Expect(copy.Raw()).NotTo(Equal(stringMap.Raw()))
262-
Expect(copy.Len()).To(Equal(stringMap.Len()))
263-
copy.Set("detector2", "test2")
264-
Expect(copy.Len()).To(Equal(stringMap.Len() + 1))
253+
mapCopy := stringMap.Copy()
254+
Expect(mapCopy).NotTo(BeNil())
255+
Expect(mapCopy == stringMap).NotTo(BeTrue())
256+
Expect(mapCopy).To(Equal(stringMap))
257+
Expect(mapCopy.Raw()).To(Equal(stringMap.Raw()))
258+
Expect(mapCopy.Len()).To(Equal(stringMap.Len()))
259+
mapCopy.Set("detector", "test")
260+
Expect(mapCopy).NotTo(Equal(stringMap))
261+
Expect(mapCopy.Raw()).NotTo(Equal(stringMap.Raw()))
262+
Expect(mapCopy.Len()).To(Equal(stringMap.Len()))
263+
mapCopy.Set("detector2", "test2")
264+
Expect(mapCopy.Len()).To(Equal(stringMap.Len() + 1))
265265
})
266266

267267
It("should correctly return a copy of the underlying map", func() {

common/monitoring/metricsreservoirsampling.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ func (this *MetricsReservoirSampling) GetMetrics() []Metric {
8888
for key, reservoirMetric := range this.metricsBuckets {
8989
m := Metric{name: reservoirMetric.metric.name, tags: reservoirMetric.metric.tags, timestamp: key.timestamp}
9090

91-
mean, median, min, p10, p30, p70, p90, max, count, poolSize := reservoirMetric.reservoir.GetStats()
91+
mean, median, minimum, p10, p30, p70, p90, maximum, count, poolSize := reservoirMetric.reservoir.GetStats()
9292

9393
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_mean", mean)
9494
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_median", median)
95-
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_min", min)
95+
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_min", minimum)
9696
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_p10", p10)
9797
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_p30", p30)
9898
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_p70", p70)
9999
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_p90", p90)
100-
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_max", max)
100+
m.SetFieldFloat64(reservoirMetric.reservoir.name+"_max", maximum)
101101
m.SetFieldUInt64(reservoirMetric.reservoir.name+"_count", count)
102102
m.SetFieldUInt64(reservoirMetric.reservoir.name+"_poolsize", poolSize)
103103

common/monitoring/monitoring_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ func TestApproximateHistogram(t *testing.T) {
382382
histo.AddPoint(10)
383383
}
384384

385-
mean, median, min, p10, p30, p70, p90, max, count, poolSize := histo.GetStats()
385+
mean, median, minimum, p10, p30, p70, p90, maximum, count, poolSize := histo.GetStats()
386386

387387
if count != 20 {
388388
t.Errorf("wrong count before reset, expected 20, got %d", count)
@@ -392,7 +392,7 @@ func TestApproximateHistogram(t *testing.T) {
392392
t.Errorf("wrong poolSize, expected 20, got %d", poolSize)
393393
}
394394

395-
if mean != 10 || median != 10 || min != 10 || p10 != 10 || p30 != 10 || p70 != 10 || p90 != 10 || max != 10 {
395+
if mean != 10 || median != 10 || minimum != 10 || p10 != 10 || p30 != 10 || p70 != 10 || p90 != 10 || maximum != 10 {
396396
t.Errorf("one of the values is not 10 when it should be 10, mean %v, median %v, 10p %v, 30p %v, 70p %v, 90p %v", mean, median, p10, p30, p70, p90)
397397
}
398398

core/server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ func (m *RpcServer) GetFrameworkInfo(context.Context, *pb.GetFrameworkInfoReques
171171
m.logMethod()
172172
defer m.logMethodHandled()
173173

174-
maj, _ := strconv.ParseInt(product.VERSION_MAJOR, 10, 32)
175-
min, _ := strconv.ParseInt(product.VERSION_MINOR, 10, 32)
176-
pat, _ := strconv.ParseInt(product.VERSION_PATCH, 10, 32)
174+
major, _ := strconv.ParseInt(product.VERSION_MAJOR, 10, 32)
175+
minor, _ := strconv.ParseInt(product.VERSION_MINOR, 10, 32)
176+
patch, _ := strconv.ParseInt(product.VERSION_PATCH, 10, 32)
177177

178178
availableDetectors, activeDetectors, allDetectors, err := m.listDetectors()
179179
if err != nil {
@@ -190,9 +190,9 @@ func (m *RpcServer) GetFrameworkInfo(context.Context, *pb.GetFrameworkInfoReques
190190
HostsCount: int32(m.state.taskman.AgentCache.Count()),
191191
InstanceName: viper.GetString("instanceName"),
192192
Version: &pb.Version{
193-
Major: int32(maj),
194-
Minor: int32(min),
195-
Patch: int32(pat),
193+
Major: int32(major),
194+
Minor: int32(minor),
195+
Patch: int32(patch),
196196
Build: product.BUILD,
197197
VersionStr: product.VERSION,
198198
ProductName: product.PRETTY_SHORTNAME,

0 commit comments

Comments
 (0)