github.com/in4it/ecs-deploy@v0.0.42-0.20240508120354-ed77ff16df25/api/sort.go (about) 1 package api 2 3 import ( 4 "github.com/in4it/ecs-deploy/service" 5 ) 6 7 type ruleConditionSort []*service.DeployRuleConditions 8 9 func (s ruleConditionSort) Len() int { 10 return len(s) 11 } 12 func (s ruleConditionSort) Swap(i, j int) { 13 s[i], s[j] = s[j], s[i] 14 } 15 func (s ruleConditionSort) Less(i, j int) bool { 16 return len(s[i].PathPattern) > len(s[j].PathPattern) 17 }