wire: Use ordered Service Flags. (#182)
This modifies the wire.ServiceFlag stringer to use the ordered slice of flags to ensure that the human readable representation of the flags is always in a well defined order. This is not only useful for humans, but it also allows the output to be deterministically tested.
This commit is contained in:
parent
28f5ce5e44
commit
9c238a8341
@ -54,9 +54,9 @@ func (f ServiceFlag) String() string {
|
||||
|
||||
// Add individual bit flags.
|
||||
s := ""
|
||||
for flag, name := range sfStrings {
|
||||
for _, flag := range orderedSFStrings {
|
||||
if f&flag == flag {
|
||||
s += name + "|"
|
||||
s += sfStrings[flag] + "|"
|
||||
f -= flag
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user