This commit is contained in:
hdt3213
2021-11-08 23:24:43 +08:00
parent 4163a45278
commit 38001a2d18
12 changed files with 41 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ func ToCmdLine(cmd ...string) [][]byte {
return args
}
// ToCmdLine2 convert commandName and string-type argument to [][]byte
func ToCmdLine2(commandName string, args ...string) [][]byte {
result := make([][]byte, len(args)+1)
result[0] = []byte(commandName)
@@ -18,6 +19,7 @@ func ToCmdLine2(commandName string, args ...string) [][]byte {
return result
}
// ToCmdLine3 convert commandName and []byte-type argument to CmdLine
func ToCmdLine3(commandName string, args ...[]byte) [][]byte {
result := make([][]byte, len(args)+1)
result[0] = []byte(commandName)