@@ -765,11 +765,12 @@ func TestVerticalShardingFuzz(t *testing.T) {
765765 // Generate another set of series for testing binary expression and vector matching.
766766 for i := numSeries ; i < 2 * numSeries ; i ++ {
767767 prompbLabels := []prompb.Label {{Name : "job" , Value : "test" }, {Name : "series" , Value : strconv .Itoa (i )}}
768- if i % 3 == 0 {
768+ switch i % 3 {
769+ case 0 :
769770 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "200" })
770- } else if i % 3 == 1 {
771+ case 1 :
771772 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "400" })
772- } else {
773+ default :
773774 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "500" })
774775 }
775776 series := e2e .GenerateSeriesWithSamples ("test_series_b" , start , scrapeInterval , i * numSamples , numSamples , prompbLabels ... )
@@ -882,11 +883,12 @@ func TestProtobufCodecFuzz(t *testing.T) {
882883 // Generate another set of series for testing binary expression and vector matching.
883884 for i := numSeries ; i < 2 * numSeries ; i ++ {
884885 prompbLabels := []prompb.Label {{Name : "job" , Value : "test" }, {Name : "series" , Value : strconv .Itoa (i )}}
885- if i % 3 == 0 {
886+ switch i % 3 {
887+ case 0 :
886888 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "200" })
887- } else if i % 3 == 1 {
889+ case 1 :
888890 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "400" })
889- } else {
891+ default :
890892 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "500" })
891893 }
892894 series := e2e .GenerateSeriesWithSamples ("test_series_b" , start , scrapeInterval , i * numSamples , numSamples , prompbLabels ... )
@@ -1578,11 +1580,12 @@ func TestBackwardCompatibilityQueryFuzz(t *testing.T) {
15781580 // Generate another set of series for testing binary expression and vector matching.
15791581 for i := numSeries ; i < 2 * numSeries ; i ++ {
15801582 prompbLabels := []prompb.Label {{Name : "job" , Value : "test" }, {Name : "series" , Value : strconv .Itoa (i )}}
1581- if i % 3 == 0 {
1583+ switch i % 3 {
1584+ case 0 :
15821585 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "200" })
1583- } else if i % 3 == 1 {
1586+ case 1 :
15841587 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "400" })
1585- } else {
1588+ default :
15861589 prompbLabels = append (prompbLabels , prompb.Label {Name : "status_code" , Value : "500" })
15871590 }
15881591 series := e2e .GenerateSeriesWithSamples ("test_series_b" , start , scrapeInterval , i * numSamples , numSamples , prompbLabels ... )
0 commit comments