MCPcopy
hub / github.com/digitalocean/doctl / GetString

Method GetString

doit.go:364–372  ·  view source on GitHub ↗

GetString returns a config value as a string.

(ns, key string)

Source from the content-addressed store, hash-verified

362
363// GetString returns a config value as a string.
364func (c *LiveConfig) GetString(ns, key string) (string, error) {
365 nskey := nskey(ns, key)
366 str := viper.GetString(nskey)
367
368 if isRequired(nskey) && strings.TrimSpace(str) == "" {
369 return "", NewMissingArgsErr(nskey)
370 }
371 return str, nil
372}
373
374// GetBool returns a config value as a bool.
375func (c *LiveConfig) GetBool(ns, key string) (bool, error) {

Callers

nothing calls this directly

Calls 4

nskeyFunction · 0.85
isRequiredFunction · 0.85
NewMissingArgsErrFunction · 0.85
GetStringMethod · 0.65

Tested by

no test coverage detected