Fix ListZones output for all query on get-zones

This commit is contained in:
Robert Blenkinsopp 2020-08-21 14:29:01 +01:00
parent a2fd3be532
commit 7d73245e4f

View file

@ -6,6 +6,7 @@ import (
"net/http"
"net/http/cookiejar"
"net/url"
"sort"
"strconv"
"strings"
"time"
@ -120,12 +121,14 @@ func (c *ApiClient) ListZones() ([]string, error) {
return nil, err
}
// Get the list of the domains
domains := make([]string, 0, len(domainsMap))
for _, key := range domains {
domains = append(domains, key)
for domain := range domainsMap {
domains = append(domains, domain)
}
// Ensure the order is deterministic
sort.Strings(domains)
return domains, err
}