Jelajahi Sumber

Merge pull request #13095 from Microsoft/10662-pkgrexec

Windows: reexec pkg supported
Alexander Morozov 10 tahun lalu
induk
melakukan
61cb6012e6
2 mengubah file dengan 15 tambahan dan 1 penghapusan
  1. 1 1
      pkg/reexec/command_unsupported.go
  2. 14 0
      pkg/reexec/command_windows.go

+ 1 - 1
pkg/reexec/command_unsupported.go

@@ -1,4 +1,4 @@
-// +build !linux
+// +build !linux,!windows
 
 package reexec
 

+ 14 - 0
pkg/reexec/command_windows.go

@@ -0,0 +1,14 @@
+// +build windows
+
+package reexec
+
+import (
+	"os/exec"
+)
+
+func Command(args ...string) *exec.Cmd {
+	return &exec.Cmd{
+		Path: Self(),
+		Args: args,
+	}
+}