MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / hasPathPrefix

Function hasPathPrefix

commands/api.go:78–90  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

76}
77
78func hasPathPrefix(path string) (error, bool) {
79 if !strings.HasPrefix(path, "/") {
80 whisk.Debug(whisk.DbgError, "path does not begin with '/': '%s'\n", path)
81 errMsg := wski18n.T("'{{.path}}' must begin with '/'.",
82 map[string]interface{}{
83 "path": path,
84 })
85 whiskErr := whisk.MakeWskError(errors.New(errMsg), whisk.EXIT_CODE_ERR_GENERAL,
86 whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
87 return whiskErr, false
88 }
89 return nil, true
90}
91
92func isValidBasepath(basepath string) (error, bool) {
93 if whiskerr, ok := hasPathPrefix(basepath); !ok {

Callers 2

isValidBasepathFunction · 0.85
isValidRelpathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected