Skip to content

Commit

Permalink
Check the type assertion on funk.Keys return value. (#1256)
Browse files Browse the repository at this point in the history
Make lint happy again.
This was result of a race between merging #1223 and #1245
  • Loading branch information
porridge committed Jan 8, 2020
1 parent 20bdc93 commit 6dcbee3
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 6dcbee3

Please sign in to comment.