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

Method GetFloat64

doit.go:414–422  ·  view source on GitHub ↗

GetFloat64 returns a config value as a float64.

(ns, key string)

Source from the content-addressed store, hash-verified

412
413// GetFloat64 returns a config value as a float64.
414func (c *LiveConfig) GetFloat64(ns, key string) (float64, error) {
415 nskey := nskey(ns, key)
416 val := viper.GetFloat64(nskey)
417
418 if isRequired(nskey) && val == 0.0 {
419 return 0.0, NewMissingArgsErr(nskey)
420 }
421 return val, nil
422}
423
424// GetStringSlice returns a config value as a string slice.
425func (c *LiveConfig) GetStringSlice(ns, key string) ([]string, error) {

Callers

nothing calls this directly

Calls 4

nskeyFunction · 0.85
isRequiredFunction · 0.85
NewMissingArgsErrFunction · 0.85
GetFloat64Method · 0.65

Tested by

no test coverage detected