Skip to content

Commit bd2e288

Browse files
committed
pkg/system: remove unused CommandLineToArgv
This function was added in 9c4570a, 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 <[email protected]>
1 parent 6004b9a commit bd2e288

2 files changed

Lines changed: 0 additions & 29 deletions

File tree

pkg/system/syscall_unix.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,3 @@ import "golang.org/x/sys/unix"
99
func Unmount(dest string) error {
1010
return unix.Unmount(dest, 0)
1111
}
12-
13-
// CommandLineToArgv should not be used on Unix.
14-
// It simply returns commandLine in the only element in the returned array.
15-
func CommandLineToArgv(commandLine string) ([]string, error) {
16-
return []string{commandLine}, nil
17-
}

pkg/system/syscall_windows.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,6 @@ func Unmount(_ string) error {
104104
return nil
105105
}
106106

107-
// CommandLineToArgv wraps the Windows syscall to turn a commandline into an argument array.
108-
func CommandLineToArgv(commandLine string) ([]string, error) {
109-
var argc int32
110-
111-
argsPtr, err := windows.UTF16PtrFromString(commandLine)
112-
if err != nil {
113-
return nil, err
114-
}
115-
116-
argv, err := windows.CommandLineToArgv(argsPtr, &argc)
117-
if err != nil {
118-
return nil, err
119-
}
120-
defer windows.LocalFree(windows.Handle(uintptr(unsafe.Pointer(argv))))
121-
122-
newArgs := make([]string, argc)
123-
for i, v := range (*argv)[:argc] {
124-
newArgs[i] = windows.UTF16ToString((*v)[:])
125-
}
126-
127-
return newArgs, nil
128-
}
129-
130107
// HasWin32KSupport determines whether containers that depend on win32k can
131108
// run on this machine. Win32k is the driver used to implement windowing.
132109
func HasWin32KSupport() bool {

0 commit comments

Comments
 (0)