(path string)
| 76 | } |
| 77 | |
| 78 | func 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 | |
| 92 | func isValidBasepath(basepath string) (error, bool) { |
| 93 | if whiskerr, ok := hasPathPrefix(basepath); !ok { |
no outgoing calls
no test coverage detected