TUN-3161: Upgrade golang.org/x/ deps

This commit is contained in:
Adam Chalmers
2020-07-06 11:22:27 -05:00
parent 92765b4261
commit a99780ed9d
234 changed files with 21522 additions and 87374 deletions

View File

@@ -8,7 +8,6 @@ package windows
import (
"syscall"
"unicode/utf16"
"unsafe"
)
@@ -40,17 +39,11 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) {
defer DestroyEnvironmentBlock(block)
blockp := uintptr(unsafe.Pointer(block))
for {
entry := (*[(1 << 30) - 1]uint16)(unsafe.Pointer(blockp))[:]
for i, v := range entry {
if v == 0 {
entry = entry[:i]
break
}
}
entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp)))
if len(entry) == 0 {
break
}
env = append(env, string(utf16.Decode(entry)))
env = append(env, entry)
blockp += 2 * (uintptr(len(entry)) + 1)
}
return env, nil