github.com/lacework-dev/go-moby@v20.10.12+incompatible/pkg/reexec/command_windows.go (about)

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