Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit b967807

Browse files
committed
Fix shadowed nested iteration
Reported by @chasewalden, thanks!
1 parent de3535f commit b967807

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/redskyctl/cmd/get/trial_list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ func getKubernetesTrialList(o *GetOptions, meta *trialTableMeta) (*redskyapi.Tri
141141
} else {
142142
for i := range tl.Items {
143143
t := redskyapi.TrialItem{TrialValues: *server.FromClusterTrial(&tl.Items[i])}
144-
for i := range tl.Items[i].Spec.Assignments {
144+
for j := range tl.Items[i].Spec.Assignments {
145145
t.TrialAssignments.Assignments = append(t.TrialAssignments.Assignments, redskyapi.Assignment{
146-
ParameterName: tl.Items[i].Spec.Assignments[i].Name,
147-
Value: json.Number(strconv.FormatInt(tl.Items[i].Spec.Assignments[i].Value, 10)),
146+
ParameterName: tl.Items[i].Spec.Assignments[j].Name,
147+
Value: json.Number(strconv.FormatInt(tl.Items[i].Spec.Assignments[j].Value, 10)),
148148
})
149149
}
150150

0 commit comments

Comments
 (0)