summaryrefslogtreecommitdiff
path: root/internal/discovery/comma.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/discovery/comma.go')
-rw-r--r--internal/discovery/comma.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/internal/discovery/comma.go b/internal/discovery/comma.go
index 9bea89c..126cbec 100644
--- a/internal/discovery/comma.go
+++ b/internal/discovery/comma.go
@@ -9,5 +9,18 @@ import (
// ServerListFromCOMMA retrieves a list of servers from comma separated input list.
func (d *Discovery) ServerListFromCOMMA() []string {
dlog.Common.Debug("Retrieving server list from comma separated list", d.server)
- return strings.Split(d.server, ",")
+
+ rawServers := strings.Split(d.server, ",")
+ servers := make([]string, 0, len(rawServers))
+ for _, server := range rawServers {
+ if server == "" {
+ continue
+ }
+ servers = append(servers, server)
+ }
+ if len(servers) == 0 && d.server == "" {
+ return rawServers
+ }
+
+ return servers
}