mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-23 12:40:19 +01:00
cb6e5cb0c7
* use dep for vendoring * lets encrypt * moved web to transfer.sh-web repo * single command install * added first tests
20 lines
377 B
Go
20 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
|
|
}
|
|
}
|
|
}
|
|
}
|