client: s/v2URL/v2KeysURL/

This commit is contained in:
Brian Waldon 2014-10-23 16:02:29 -07:00
parent ebe32689d4
commit a85a47c8f9
2 changed files with 5 additions and 5 deletions

View File

@ -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")

View File

@ -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)
}