os.Getenv returns a string

This commit is contained in:
chuckyz
2020-01-30 09:26:32 -08:00
parent b129bc8184
commit 52a05e0317

View File

@@ -54,7 +54,7 @@ func NewConsulMon(addr string) (*ConsulMon, error) {
func (c *ConsulMon) queryServices() ([]*App, error) { func (c *ConsulMon) queryServices() ([]*App, error) {
var apps []*App var apps []*App
stale := "" stale := ""
if os.Getenv(allowStale) { if os.Getenv(allowStale) == "true" {
stale = "?stale" stale = "?stale"
} }
addr := c.addr + fmt.Sprintf("%s/%s%s", nodeURL, c.node, stale) addr := c.addr + fmt.Sprintf("%s/%s%s", nodeURL, c.node, stale)