This commit is contained in:
Alliballibaba
2024-11-07 00:30:01 +01:00
parent d6c5d04b83
commit 9cf58c4835

View File

@@ -334,12 +334,12 @@ func Init(options ...Option) error {
}
// load the os environment once
// prevents potential segfaults if it's is accessed from anywhere else
cachedEnv = make(map[string]string, len(os.Environ()))
for _, envVar := range os.Environ() {
key, val, _ := strings.Cut(envVar, "=")
cachedEnv[key] = val
}
// prevents potential segfaults if it's is accessed from anywhere else
cachedEnv = make(map[string]string, len(os.Environ()))
for _, envVar := range os.Environ() {
key, val, _ := strings.Cut(envVar, "=")
cachedEnv[key] = val
}
shutdownWG.Add(1)
done = make(chan struct{})