From 420631e748925d8f3542fc734ab6b5f809629d83 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Sun, 6 May 2018 20:36:52 -0700 Subject: [PATCH] remove last vestiges of passing URI via context this chould be safe as context.WithValue doesn't seem to appear anywhere else in Pilosa --- client.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/client.go b/client.go index 8950e8406..314f7d4e2 100644 --- a/client.go +++ b/client.go @@ -88,7 +88,7 @@ func (c *InternalHTTPClient) MaxInverseSliceByIndex(ctx context.Context) (map[st // maxSliceByIndex returns the number of slices on a server by index. func (c *InternalHTTPClient) maxSliceByIndex(ctx context.Context, inverse bool) (map[string]uint64, error) { // Execute request against the host. - u := uriPathToURL(c.clientURI(ctx), "/slices/max") + u := uriPathToURL(c.defaultURI, "/slices/max") // Build request. req, err := http.NewRequest("GET", u.String(), nil) @@ -1137,16 +1137,6 @@ func (c *InternalHTTPClient) SendMessage(ctx context.Context, uri *URI, pb proto return nil } -func (c *InternalHTTPClient) clientURI(ctx context.Context) *URI { - clientURI := c.defaultURI - if contextURI, ok := ctx.Value("uri").(*URI); ok { - clientURI = contextURI - } else if contextURI, ok := ctx.Value("uri").(URI); ok { - clientURI = &contextURI - } - return clientURI -} - // Bit represents the location of a single bit. type Bit struct { RowID uint64