You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, fmt.Errorf("utilization values must be sorted. Utilization[%d]==%d >= Utilization[%d]==%d", i-1, points[i-1].Utilization, i, points[i].Utilization)
132
+
fori:=1; i<len(shape); i++ {
133
+
ifshape[i-1].utilization>=shape[i].utilization {
134
+
returnfmt.Errorf("utilization values must be sorted. Utilization[%d]==%d >= Utilization[%d]==%d", i-1, shape[i-1].utilization, i, shape[i].utilization)
115
135
}
116
136
}
117
137
118
-
fori, point:=rangepoints {
119
-
ifpoint.Utilization<minUtilization {
120
-
returnnil, fmt.Errorf("utilization values must not be less than %d. Utilization[%d]==%d", minUtilization, i, point.Utilization)
138
+
fori, point:=rangeshape {
139
+
ifpoint.utilization<minUtilization {
140
+
returnfmt.Errorf("utilization values must not be less than %d. Utilization[%d]==%d", minUtilization, i, point.utilization)
121
141
}
122
-
ifpoint.Utilization>maxUtilization {
123
-
returnnil, fmt.Errorf("utilization values must not be greater than %d. Utilization[%d]==%d", maxUtilization, i, point.Utilization)
142
+
ifpoint.utilization>maxUtilization {
143
+
returnfmt.Errorf("utilization values must not be greater than %d. Utilization[%d]==%d", maxUtilization, i, point.utilization)
124
144
}
125
-
ifpoint.Score<minScore {
126
-
returnnil, fmt.Errorf("score values must not be less than %d. Score[%d]==%d", minScore, i, point.Score)
145
+
ifpoint.score<minScore {
146
+
returnfmt.Errorf("score values must not be less than %d. Score[%d]==%d", minScore, i, point.score)
127
147
}
128
-
ifpoint.Score>maxScore {
129
-
returnnil, fmt.Errorf("score valuses not be greater than %d. Score[%d]==%d", maxScore, i, point.Score)
148
+
ifint64(point.score)>maxScore {
149
+
returnfmt.Errorf("score values not be greater than %d. Score[%d]==%d", maxScore, i, point.score)
130
150
}
131
151
}
132
152
133
-
// We make defensive copy so we make no assumption if array passed as argument is not changed afterwards
0 commit comments