fix: sort method

main
sundowndev 2021-03-22 11:59:09 +01:00
parent 7c7d24f76a
commit a714bab62a
No known key found for this signature in database
GPG Key ID: 8916203E540C65A4
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,10 @@ func IsSameResource(rRs, lRs Resource) bool {
func Sort(res []Resource) []Resource {
sort.SliceStable(res, func(i, j int) bool {
return res[i].TerraformType() < res[j].TerraformType() || res[i].TerraformId() < res[j].TerraformId()
if res[i].TerraformType() != res[j].TerraformType() {
return res[i].TerraformType() < res[j].TerraformType()
}
return res[i].TerraformId() < res[j].TerraformId()
})
return res
}