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

Function parseShared

commands/util.go:1034–1056  ·  view source on GitHub ↗
(shared string)

Source from the content-addressed store, hash-verified

1032}
1033
1034func parseShared(shared string) (bool, bool, error) {
1035 var isShared, isSet bool
1036
1037 if strings.ToLower(shared) == "yes" {
1038 isShared = true
1039 isSet = true
1040 } else if strings.ToLower(shared) == "no" {
1041 isShared = false
1042 isSet = true
1043 } else if len(shared) == 0 {
1044 isSet = false
1045 } else {
1046 whisk.Debug(whisk.DbgError, "Cannot use value '%s' for shared.\n", shared)
1047 errMsg := wski18n.T("Cannot use value '{{.arg}}' for shared.", map[string]interface{}{"arg": shared})
1048 whiskErr := whisk.MakeWskError(errors.New(errMsg), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG,
1049 whisk.DISPLAY_USAGE)
1050 return false, false, whiskErr
1051 }
1052
1053 whisk.Debug(whisk.DbgError, "Sharing is '%t'\n", isShared)
1054
1055 return isShared, isSet, nil
1056}
1057
1058func max(a int, b int) int {
1059 if a > b {

Callers 1

package.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected