command: fix env var reader for HTTP addr

This commit is contained in:
Ryan Uber 2015-01-16 14:01:14 -08:00
parent 8ded1063db
commit 952fac6552
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ func HTTPClient(addr string) (*consulapi.Client, error) {
// HTTPClientDC returns a new Consul HTTP client with the given address and datacenter
func HTTPClientDC(addr, dc string) (*consulapi.Client, error) {
conf := consulapi.DefaultConfig()
if envAddr := os.Getenv("CONSUL_HTTP_ADDR"); addr != "" {
if envAddr := os.Getenv("CONSUL_HTTP_ADDR"); envAddr != "" {
addr = envAddr
}
conf.Address = addr