commit | a844064988727fb391e308c3564c20462ad7416b | [log] [tgz] |
---|---|---|
author | Ash Wilson <smashwilson@gmail.com> | Tue Oct 07 09:55:58 2014 -0400 |
committer | Ash Wilson <smashwilson@gmail.com> | Tue Oct 07 09:57:17 2014 -0400 |
tree | cd79d6069aa2e6193e958fbdecb495ab988df9c1 | |
parent | c388f65bc86aad2b50adef1f77a6e6322b0fa333 [diff] [blame] |
Move NormalizeURL to the root package.
diff --git a/util.go b/util.go index c424759..1715458 100644 --- a/util.go +++ b/util.go
@@ -2,6 +2,7 @@ import ( "fmt" + "strings" "time" ) @@ -20,3 +21,11 @@ } return fmt.Errorf("Time out in WaitFor.") } + +// NormalizeURL ensures that each endpoint URL has a closing `/`, as expected by ServiceClient. +func NormalizeURL(url string) string { + if !strings.HasSuffix(url, "/") { + return url + "/" + } + return url +}