0
0
mirror of https://github.com/thegeeklab/wp-matrix.git synced 2024-11-14 10:00:39 +00:00
wp-matrix/vendor/github.com/urfave/cli/helpers_windows_test.go
2018-01-08 09:54:13 +01:00

21 lines
377 B
Go

package cli
import (
"os"
"syscall"
)
// os.Clearenv() doesn't actually unset variables on Windows
// See: https://github.com/golang/go/issues/17902
func clearenv() {
for _, s := range os.Environ() {
for j := 1; j < len(s); j++ {
if s[j] == '=' {
keyp, _ := syscall.UTF16PtrFromString(s[0:j])
syscall.SetEnvironmentVariable(keyp, nil)
break
}
}
}
}