Skip to content

Commit

Permalink
go fmt and vet fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Fitzpatrick committed Jul 16, 2021
1 parent 1a294f6 commit 0c4318b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
6 changes: 4 additions & 2 deletions pkg/core/writer/signalfx/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestIsTransientError(t *testing.T) {
notTemporary := tempError{func() bool { return false }}
wrappedNotTemporary := fmt.Errorf("%w", notTemporary)

for _, test := range []struct {
tests := []struct {
name string
err error
expected bool
Expand All @@ -81,7 +81,9 @@ func TestIsTransientError(t *testing.T) {
{"not temporary error", notTemporary, false},
{"wrapped not temporary error", wrappedNotTemporary, false},
{"doubly wrapped not temporary error", fmt.Errorf("%w", wrappedNotTemporary), false},
} {
}
for i := range tests {
test := tests[i]
t.Run(test.name, func(tt *testing.T) {
require.Equal(tt, test.expected, isTransientError(test.err))
})
Expand Down
12 changes: 6 additions & 6 deletions pkg/monitors/elasticsearch/query/datapoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestExtendedStatsAggregationsFromFiltersAggregation(t *testing.T) {
"max": 100.0,
"avg": 50.14530580444098,
"sum": 257446.0,
"sum_of_squares": 1.7184548E7,
"sum_of_squares": 1.7184548e7,
"variance": 832.6528246727477,
"std_deviation": 28.855724296450223,
"std_deviation_bounds": map[string]interface{}{
Expand All @@ -162,7 +162,7 @@ func TestExtendedStatsAggregationsFromFiltersAggregation(t *testing.T) {
"max": 100.0,
"avg": 50.03486560186989,
"sum": 256879.0,
"sum_of_squares": 1.7288541E7,
"sum_of_squares": 1.7288541e7,
"variance": 863.9724891034797,
"std_deviation": 29.39340893981982,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -232,7 +232,7 @@ func TestExtendedStatsAggregationsFromFiltersAggregation(t *testing.T) {
{
Metric: "metric_agg_1.sum_of_squares",
Dimensions: dims["madrid"],
Value: datapoint.NewFloatValue(1.7288541E7),
Value: datapoint.NewFloatValue(1.7288541e7),
MetricType: datapoint.Gauge,
},
{
Expand Down Expand Up @@ -292,7 +292,7 @@ func TestExtendedStatsAggregationsFromFiltersAggregation(t *testing.T) {
{
Metric: "metric_agg_1.sum_of_squares",
Dimensions: dims["nairobi"],
Value: datapoint.NewFloatValue(1.7184548E7),
Value: datapoint.NewFloatValue(1.7184548e7),
MetricType: datapoint.Gauge,
},
{
Expand Down Expand Up @@ -455,7 +455,7 @@ func TestMultipleMetricAggregationWithTermsAggregation(t *testing.T) {
"max": 100.0,
"avg": 50.14530580444098,
"sum": 257446.0,
"sum_of_squares": 1.7184548E7,
"sum_of_squares": 1.7184548e7,
"variance": 832.6528246727477,
"std_deviation": 28.855724296450223,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -559,7 +559,7 @@ func TestMultipleMetricAggregationWithTermsAggregation(t *testing.T) {
{
Metric: "metric_agg_3.sum_of_squares",
Dimensions: dims["metric_agg_3"],
Value: datapoint.NewFloatValue(1.7184548E7),
Value: datapoint.NewFloatValue(1.7184548e7),
MetricType: datapoint.Gauge,
},
{
Expand Down
16 changes: 8 additions & 8 deletions pkg/monitors/elasticsearch/query/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ func getSimpleMultiValueAggregationTestContexts() ([]*testContext, *errors.Error
"max": 100.0,
"avg": 49.27212287941311,
"sum": 214925.0,
"sum_of_squares": 1.4335299E7,
"sum_of_squares": 1.4335299e7,
"variance": 858.662996364543,
"std_deviation": 29.302952007682485,
"std_deviation_bounds": map[string]interface{}{
Expand All @@ -624,7 +624,7 @@ func getSimpleMultiValueAggregationTestContexts() ([]*testContext, *errors.Error
"max": 100.0,
"avg": 50.197615772581386,
"sum": 218962.0,
"sum_of_squares": 1.4644106E7,
"sum_of_squares": 1.4644106e7,
"variance": 837.3992790472341,
"std_deviation": 28.93785201163407,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -820,7 +820,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 50.14530580444098,
"sum": 257446.0,
"sum_of_squares": 1.7184548E7,
"sum_of_squares": 1.7184548e7,
"variance": 832.6528246727477,
"std_deviation": 28.855724296450223,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -861,7 +861,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 50.03486560186989,
"sum": 256879.0,
"sum_of_squares": 1.7288541E7,
"sum_of_squares": 1.7288541e7,
"variance": 863.9724891034797,
"std_deviation": 29.39340893981982,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -902,7 +902,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 49.577522399688355,
"sum": 254531.0,
"sum_of_squares": 1.7057901E7,
"sum_of_squares": 1.7057901e7,
"variance": 864.6055017695604,
"std_deviation": 29.40417490373706,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -943,7 +943,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 49.273081417997666,
"sum": 252968.0,
"sum_of_squares": 1.6862378E7,
"sum_of_squares": 1.6862378e7,
"variance": 856.6157265001883,
"std_deviation": 29.267998334361515,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -994,7 +994,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 50.084047707789786,
"sum": 268751.0,
"sum_of_squares": 1.7938575E7,
"sum_of_squares": 1.7938575e7,
"variance": 834.5950604703294,
"std_deviation": 28.889358948760517,
"std_deviation_bounds": map[string]interface{}{
Expand Down Expand Up @@ -1035,7 +1035,7 @@ func getMultipleMetricAggregationTestContexts() ([]*testContext, *errors.Error)
"max": 100.0,
"avg": 49.27953783078643,
"sum": 264434.0,
"sum_of_squares": 1.7629144E7,
"sum_of_squares": 1.7629144e7,
"variance": 856.8689327718637,
"std_deviation": 29.27232366539875,
"std_deviation_bounds": map[string]interface{}{
Expand Down

0 comments on commit 0c4318b

Please sign in to comment.