(data importDataList)
| 420 | } |
| 421 | |
| 422 | func deduplicateResourceNames(data importDataList) importDataList { |
| 423 | nameMap := map[string]int{} |
| 424 | deduplicatedList := importDataList{} |
| 425 | |
| 426 | for _, resource := range data { |
| 427 | nameMap[resource.ResourceName]++ |
| 428 | if nameMap[resource.ResourceName] > 1 { |
| 429 | resource.ResourceName = fmt.Sprintf("%s_%d", resource.ResourceName, nameMap[resource.ResourceName]) |
| 430 | } |
| 431 | |
| 432 | deduplicatedList = append(deduplicatedList, resource) |
| 433 | } |
| 434 | |
| 435 | return deduplicatedList |
| 436 | } |
| 437 | |
| 438 | func checkOutputDirectoryIsEmpty(cli *cli, cmd *cobra.Command, outputDIR string) bool { |
| 439 | _, err := os.Stat(outputDIR) |
no outgoing calls