github.com/damirazo/docker@v1.9.0/pkg/reexec/command_windows.go (about)

     1  // +build windows
     2  
     3  package reexec
     4  
     5  import (
     6  	"os/exec"
     7  )
     8  
     9  // Self returns the path to the current process's binary.
    10  // Uses os.Args[0].
    11  func Self() string {
    12  	return naiveSelf()
    13  }
    14  
    15  // Command returns *exec.Cmd which have Path as current binary.
    16  // For example if current binary is "docker.exe" at "C:\", then cmd.Path will
    17  // be set to "C:\docker.exe".
    18  func Command(args ...string) *exec.Cmd {
    19  	return &exec.Cmd{
    20  		Path: Self(),
    21  		Args: args,
    22  	}
    23  }