From 56c139f003292005dd5dd974ffd770b8620e8aef Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 28 Jul 2022 15:44:36 -0600 Subject: [PATCH] Fix compilation on Windows --- cmd/removebinary_windows.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/removebinary_windows.go b/cmd/removebinary_windows.go index 3a6df667..8cc271ad 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) }