pkg/system: remove unused CommandLineToArgv

This function was added in 9c4570a958,
but appears to never have been used.

Removing it, as it's not used in the codebase and, from a quick
search on GitHub, also doesn't look to be used by other projects.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-03-09 17:02:53 +01:00
parent 6004b9ad52
commit bd2e288e56
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 0 additions and 29 deletions

View file

@ -9,9 +9,3 @@ import "golang.org/x/sys/unix"
func Unmount(dest string) error {
return unix.Unmount(dest, 0)
}
// CommandLineToArgv should not be used on Unix.
// It simply returns commandLine in the only element in the returned array.
func CommandLineToArgv(commandLine string) ([]string, error) {
return []string{commandLine}, nil
}

View file

@ -104,29 +104,6 @@ func Unmount(_ string) error {
return nil
}
// CommandLineToArgv wraps the Windows syscall to turn a commandline into an argument array.
func CommandLineToArgv(commandLine string) ([]string, error) {
var argc int32
argsPtr, err := windows.UTF16PtrFromString(commandLine)
if err != nil {
return nil, err
}
argv, err := windows.CommandLineToArgv(argsPtr, &argc)
if err != nil {
return nil, err
}
defer windows.LocalFree(windows.Handle(uintptr(unsafe.Pointer(argv))))
newArgs := make([]string, argc)
for i, v := range (*argv)[:argc] {
newArgs[i] = windows.UTF16ToString((*v)[:])
}
return newArgs, nil
}
// HasWin32KSupport determines whether containers that depend on win32k can
// run on this machine. Win32k is the driver used to implement windowing.
func HasWin32KSupport() bool {