Fix deprecation notice by using UTF16PtrFromString

This commit is contained in:
Matthew Holt 2022-07-28 15:23:56 -06:00
parent ff2ba6de8a
commit 2e70d1d3bf
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -31,6 +31,6 @@ import (
func removeCaddyBinary(path string) error { func removeCaddyBinary(path string) error {
var sI syscall.StartupInfo var sI syscall.StartupInfo
var pI syscall.ProcessInformation var pI syscall.ProcessInformation
argv := syscall.StringToUTF16Ptr(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path) argv := syscall.UTF16PtrFromString(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path)
return syscall.CreateProcess(nil, argv, nil, nil, true, 0, nil, nil, &sI, &pI) return syscall.CreateProcess(nil, argv, nil, nil, true, 0, nil, nil, &sI, &pI)
} }