command: fix env var reader for HTTP addr

This commit is contained in:
Ryan Uber 2015-01-16 14:01:14 -08:00
parent 7a585d7a9b
commit 41ec10a120

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