summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2022-07-28 15:44:36 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2022-07-28 15:44:36 -0600
commit56c139f003292005dd5dd974ffd770b8620e8aef (patch)
treedb94e8efcf9a8956f69c44a9612cc0f3ef7dfc31
parent35a81d7c5b4ea2bb055ec0e7e56840d45a5fe60c (diff)
Fix compilation on Windows
-rw-r--r--cmd/removebinary_windows.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/removebinary_windows.go b/cmd/removebinary_windows.go
index 3a6df66..8cc271a 100644
--- a/cmd/removebinary_windows.go
+++ b/cmd/removebinary_windows.go
@@ -31,6 +31,9 @@ import (
func removeCaddyBinary(path string) error {
var sI syscall.StartupInfo
var pI syscall.ProcessInformation
- argv := syscall.UTF16PtrFromString(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path)
+ argv, err := syscall.UTF16PtrFromString(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path)
+ if err != nil {
+ return err
+ }
return syscall.CreateProcess(nil, argv, nil, nil, true, 0, nil, nil, &sI, &pI)
}