Skip to content

Commit

Permalink
Check the type assertion on funk.Keys return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
porridge committed Jan 8, 2020
1 parent 7350929 commit b911edf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kudoctl/cmd/package_list_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ func displayPlanTable(pf *packages.Files, withTasks bool, out io.Writer) {
}

func sortedPlanNames(pf *packages.Files) []string {
planNames := funk.Keys(pf.Operator.Plans).([]string)
planNames, ok := funk.Keys(pf.Operator.Plans).([]string)
if !ok {
panic("funk.Keys returned unexpected type")
}
sort.Strings(planNames)
return planNames
}
Expand Down

0 comments on commit b911edf

Please sign in to comment.