9005: Replace matchTrue regexp with StringBool func.
[arvados.git] / sdk / go / keepclient / support.go
index 0e74892a40951af958ba19137930d4ca63121b0a..8545cb80b855d9e53606042bfc940df7388e51eb 100644 (file)
@@ -10,9 +10,9 @@ import (
        "math/rand"
        "net/http"
        "os"
-       "regexp"
        "strings"
 
+       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
        "git.curoverse.com/arvados.git/sdk/go/streamer"
 )
 
@@ -22,8 +22,7 @@ import (
 var DebugPrintf = func(string, ...interface{}) {}
 
 func init() {
-       var matchTrue = regexp.MustCompile("^(?i:1|yes|true)$")
-       if matchTrue.MatchString(os.Getenv("ARVADOS_DEBUG")) {
+       if arvadosclient.StringBool(os.Getenv("ARVADOS_DEBUG")) {
                DebugPrintf = log.Printf
        }
 }