浏览代码

pkg/system: remove unused CommandLineToArgv

This function was added in 9c4570a958df42d1ad19364b1a8da55b891d850a,
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>
Sebastiaan van Stijn 5 年之前
父节点
当前提交
bd2e288e56
共有 2 个文件被更改,包括 0 次插入29 次删除
  1. 0 6
      pkg/system/syscall_unix.go
  2. 0 23
      pkg/system/syscall_windows.go

+ 0 - 6
pkg/system/syscall_unix.go

@@ -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
-}

+ 0 - 23
pkg/system/syscall_windows.go

@@ -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 {