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:
Dave Collins 2016-05-17 15:36:33 -05:00 committed by Alex Yocom-Piatt
parent 28f5ce5e44
commit 9c238a8341

View File

@ -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
}
}