From fabdd4a704a247dd1af5b80d5e93ecfaecac8987 Mon Sep 17 00:00:00 2001 From: chriss Date: Mon, 21 Nov 2016 16:16:24 +0000 Subject: [PATCH] Remove consul token helper method. A Consul config struct can be passed using the `Config` helper making this helper redundant. --- registry/consul/options.go | 9 --------- registry/consul_registry.go | 4 ---- 2 files changed, 13 deletions(-) diff --git a/registry/consul/options.go b/registry/consul/options.go index f85bbf79..3c28d45d 100644 --- a/registry/consul/options.go +++ b/registry/consul/options.go @@ -14,12 +14,3 @@ func Config(c *consul.Config) registry.Option { o.Context = context.WithValue(o.Context, "consul_config", c) } } - -func Token(t string) registry.Option { - return func(o *registry.Options) { - if o.Context == nil { - o.Context = context.Background() - } - o.Context = context.WithValue(o.Context, "consul_token", t) - } -} diff --git a/registry/consul_registry.go b/registry/consul_registry.go index 1f5d40b2..ec906450 100644 --- a/registry/consul_registry.go +++ b/registry/consul_registry.go @@ -58,10 +58,6 @@ func newConsulRegistry(opts ...Option) Registry { if c, ok := options.Context.Value("consul_config").(*consul.Config); ok { config = c } - - if t, ok := options.Context.Value("consul_token").(string); ok { - config.Token = t - } } // set timeout