MCPcopy
hub / github.com/filebrowser/filebrowser / convertCmdStrToCmdArray

Function convertCmdStrToCmdArray

cmd/utils.go:255–262  ·  view source on GitHub ↗

convertCmdStrToCmdArray checks if cmd string is blank (whitespace included) then returns empty string array, else returns the split word array of cmd. This is to ensure the result will never be []string{""}

(cmd string)

Source from the content-addressed store, hash-verified

253// then returns empty string array, else returns the split word array of cmd.
254// This is to ensure the result will never be []string{""}
255func convertCmdStrToCmdArray(cmd string) []string {
256 var cmdArray []string
257 trimmedCmdStr := strings.TrimSpace(cmd)
258 if trimmedCmdStr != "" {
259 cmdArray = strings.Split(trimmedCmdStr, " ")
260 }
261 return cmdArray
262}

Callers 1

getSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected