diff --git a/client/http.go b/client/http.go index cad0ad682..95947fbfe 100644 --- a/client/http.go +++ b/client/http.go @@ -192,7 +192,7 @@ func (hw *httpWatcher) Next() (*Response, error) { return resp, nil } -func v2URL(ep url.URL, key string) *url.URL { +func v2KeysURL(ep url.URL, key string) *url.URL { ep.Path = path.Join(ep.Path, DefaultV2KeysPrefix, key) return &ep } @@ -207,7 +207,7 @@ type getAction struct { } func (g *getAction) httpRequest(ep url.URL) *http.Request { - u := v2URL(ep, g.Key) + u := v2KeysURL(ep, g.Key) params := u.Query() params.Set("recursive", strconv.FormatBool(g.Recursive)) @@ -224,7 +224,7 @@ type waitAction struct { } func (w *waitAction) httpRequest(ep url.URL) *http.Request { - u := v2URL(ep, w.Key) + u := v2KeysURL(ep, w.Key) params := u.Query() params.Set("wait", "true") @@ -243,7 +243,7 @@ type createAction struct { } func (c *createAction) httpRequest(ep url.URL) *http.Request { - u := v2URL(ep, c.Key) + u := v2KeysURL(ep, c.Key) params := u.Query() params.Set("prevExist", "false") diff --git a/client/http_test.go b/client/http_test.go index c183c4e13..8b1777ad8 100644 --- a/client/http_test.go +++ b/client/http_test.go @@ -73,7 +73,7 @@ func TestV2URLHelper(t *testing.T) { } for i, tt := range tests { - got := v2URL(tt.endpoint, tt.key) + got := v2KeysURL(tt.endpoint, tt.key) if tt.want != *got { t.Errorf("#%d: want=%#v, got=%#v", i, tt.want, *got) }