diff --git a/api/api_test.go b/api/api_test.go index cca4584e06..b2b851df6e 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -10,7 +10,7 @@ import ( // testHTTPServer creates a test HTTP server that handles requests until // the listener returned is closed. func testHTTPServer( - t *testing.T, handler http.Handler) (Config, net.Listener) { + t *testing.T, handler http.Handler) (*Config, net.Listener) { ln, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("err: %s", err) diff --git a/api/client.go b/api/client.go index fd5a11ee3a..f047c76042 100644 --- a/api/client.go +++ b/api/client.go @@ -33,8 +33,8 @@ type Config struct { // DefaultConfig returns a default configuration for the client. It is // safe to modify the return value of this function. -func DefaultConfig() Config { - config := Config{ +func DefaultConfig() *Config { + config := &Config{ Address: "https://127.0.0.1:8200", HttpClient: &http.Client{}, } @@ -46,11 +46,11 @@ func DefaultConfig() Config { // NewClient. type Client struct { addr *url.URL - config Config + config *Config } // NewClient returns a new client for the given configuration. -func NewClient(c Config) (*Client, error) { +func NewClient(c *Config) (*Client, error) { u, err := url.Parse(c.Address) if err != nil { return nil, err