Commit c5a09a3d by Karsten Weiss

Remove redundant break statements (gosimple)

This fixes:
pkg/components/dynmap/dynmap.go:588:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:610:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:641:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:690:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:712:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:749:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:785:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:74:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:77:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:82:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:178:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:181:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:184:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:187:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:190:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:193:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:196:3: redundant break statement (S1023)
parent e7bcd8c3
......@@ -585,7 +585,6 @@ func (v *Value) Null() error {
switch v.data.(type) {
case nil:
valid = v.exists // Valid only if j also exists, since other values could possibly also be nil
break
}
if valid {
......@@ -607,7 +606,6 @@ func (v *Value) Array() ([]*Value, error) {
switch v.data.(type) {
case []interface{}:
valid = true
break
}
// Unsure if this is a good way to use slices, it's probably not
......@@ -638,7 +636,6 @@ func (v *Value) Number() (json.Number, error) {
switch v.data.(type) {
case json.Number:
valid = true
break
}
if valid {
......@@ -687,7 +684,6 @@ func (v *Value) Boolean() (bool, error) {
switch v.data.(type) {
case bool:
valid = true
break
}
if valid {
......@@ -709,7 +705,6 @@ func (v *Value) Object() (*Object, error) {
switch v.data.(type) {
case map[string]interface{}:
valid = true
break
}
if valid {
......@@ -746,7 +741,6 @@ func (v *Value) ObjectArray() ([]*Object, error) {
switch v.data.(type) {
case []interface{}:
valid = true
break
}
// Unsure if this is a good way to use slices, it's probably not
......@@ -782,7 +776,6 @@ func (v *Value) String() (string, error) {
switch v.data.(type) {
case string:
valid = true
break
}
if valid {
......
......@@ -71,15 +71,12 @@ func (e *CloudWatchExecutor) Query(ctx context.Context, dsInfo *models.DataSourc
switch queryType {
case "metricFindQuery":
result, err = e.executeMetricFindQuery(ctx, queryContext)
break
case "annotationQuery":
result, err = e.executeAnnotationQuery(ctx, queryContext)
break
case "timeSeriesQuery":
fallthrough
default:
result, err = e.executeTimeSeriesQuery(ctx, queryContext)
break
}
return result, err
......
......@@ -175,25 +175,18 @@ func (e *CloudWatchExecutor) executeMetricFindQuery(ctx context.Context, queryCo
switch subType {
case "regions":
data, err = e.handleGetRegions(ctx, parameters, queryContext)
break
case "namespaces":
data, err = e.handleGetNamespaces(ctx, parameters, queryContext)
break
case "metrics":
data, err = e.handleGetMetrics(ctx, parameters, queryContext)
break
case "dimension_keys":
data, err = e.handleGetDimensions(ctx, parameters, queryContext)
break
case "dimension_values":
data, err = e.handleGetDimensionValues(ctx, parameters, queryContext)
break
case "ebs_volume_ids":
data, err = e.handleGetEbsVolumeIds(ctx, parameters, queryContext)
break
case "ec2_instance_attribute":
data, err = e.handleGetEc2InstanceAttribute(ctx, parameters, queryContext)
break
}
transformToTable(data, queryResult)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment