Commit d19aa41b authored by Seth Vargo's avatar Seth Vargo
Browse files

Use a pointer config instead

parent c7843ed0
Showing with 5 additions and 5 deletions
+5 -5
......@@ -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)
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment