Skip to content

Commit

Permalink
Fix misuse of strings.TrimRight
Browse files Browse the repository at this point in the history
The function is pure, so we need to use its return value.

While at it, use a shorter variable name.
  • Loading branch information
mvdan authored and lonelycode committed Jan 16, 2017
1 parent 5d460cd commit b18c613
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions redis_signal_dash_zeroconf.go
Expand Up @@ -18,19 +18,19 @@ type DashboardConfigPayload struct {
}

func createConnectionStringFromDashboardObject(thisConfig DashboardConfigPayload) string {
thisHostname := "http://"
hostname := "http://"
if thisConfig.DashboardConfig.UseTLS {
thisHostname = "https://"
hostname = "https://"
}

thisHostname = thisHostname + thisConfig.DashboardConfig.Hostname
hostname = hostname + thisConfig.DashboardConfig.Hostname

if thisConfig.DashboardConfig.Port != 0 {
strings.TrimRight(thisHostname, "/")
thisHostname = thisHostname + ":" + strconv.Itoa(thisConfig.DashboardConfig.Port)
hostname = strings.TrimRight(hostname, "/")
hostname = hostname + ":" + strconv.Itoa(thisConfig.DashboardConfig.Port)
}

return thisHostname
return hostname
}

func HandleDashboardZeroConfMessage(payload string) {
Expand Down

0 comments on commit b18c613

Please sign in to comment.