()
| 40 | var debugEnvInitMutex sync.Mutex |
| 41 | |
| 42 | func debugEnvInit() { |
| 43 | // Only one goroutine in initialization at a time |
| 44 | if debugEnvInitialized { |
| 45 | return |
| 46 | } |
| 47 | debugEnvInitMutex.Lock() |
| 48 | defer debugEnvInitMutex.Unlock() |
| 49 | if debugEnvInitialized { |
| 50 | return |
| 51 | } |
| 52 | // Initialzie from environment variables |
| 53 | for i := range text { |
| 54 | avail, value := debugEnv(text[i]) |
| 55 | if avail { |
| 56 | *(vars[i]) = value |
| 57 | } |
| 58 | } |
| 59 | debugEnvInitialized = true |
| 60 | } |
| 61 | |
| 62 | // DebugSet sets the debug variable |
| 63 | func DebugSet(which string, value string) { |
no test coverage detected