os.Getenv returns a string
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user