Reorder items in generated source files.
Ideally they would always have been sorted as such, but this seems more critical in migrating from one service definition to another where the ordering might change.
This commit is contained in:
1 parent
730ab6506b
commit
ca81a64b42
8 files changed
+11755
-11715
No files matched your search
@@ -2,6 +2,7 @@ package scpd
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -37,6 +38,14 @@ func (scpd *SCPD) Clean() {
|
||||
}
|
||||
}
|
||||
|
||||
func (scpd *SCPD) OrderedActions() []Action {
|
||||
actions := append([]Action{}, scpd.Actions...)
|
||||
sort.SliceStable(actions, func(i, j int) bool {
|
||||
return actions[i].Name < actions[j].Name
|
||||
})
|
||||
return actions
|
||||
}
|
||||
|
||||
func (scpd *SCPD) GetStateVariable(variable string) *StateVariable {
|
||||
for i := range scpd.StateVariables {
|
||||
v := &scpd.StateVariables[i]
|
||||
|
||||
Reference in new issue
Block a user