diff --git a/api.go b/api.go index c02e67b79..28248230c 100644 --- a/api.go +++ b/api.go @@ -50,7 +50,7 @@ type API struct { } // APIOption is a functional option type for pilosa.API -type APIOption func(s *API) error +type APIOption func(*API) error func OptAPIServer(s *Server) APIOption { return func(a *API) error { diff --git a/ctl/import_test.go b/ctl/import_test.go index 717c40342..5500fdadf 100644 --- a/ctl/import_test.go +++ b/ctl/import_test.go @@ -87,11 +87,10 @@ func TestImportCommand_RunValue(t *testing.T) { } cmd := test.MustRunMainWithCluster(t, 1)[0] - hostport := cmd.Server.URI.HostPort() - cm.Host = hostport + cm.Host = cmd.Server.URI.HostPort() - http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+hostport+"/index/i", strings.NewReader(""))) - http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+hostport+"/index/i/field/f", strings.NewReader(`{"options":{"type": "int", "min": 0, "max": 100}}`))) + http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+cm.Host+"/index/i", strings.NewReader(""))) + http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+cm.Host+"/index/i/field/f", strings.NewReader(`{"options":{"type": "int", "min": 0, "max": 100}}`))) cm.Index = "i" cm.Field = "f" diff --git a/test/handler.go b/test/handler.go index 8b58d5a6e..048d9b883 100644 --- a/test/handler.go +++ b/test/handler.go @@ -46,13 +46,6 @@ func NewHandler(opts ...http.HandlerOption) (*Handler, error) { Handler: handler, } - //h.API, err = pilosa.NewAPI(OptAPIServer(s)) - if err != nil { - return nil, err - } - h.Handler.API = h.API - h.Handler.API.Executor = &h.Executor - // Handler test messages can no-op. h.API.Broadcaster = pilosa.NopBroadcaster