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

Method GetInt

doit.go:389–397  ·  view source on GitHub ↗

GetInt returns a config value as an int.

(ns, key string)

Source from the content-addressed store, hash-verified

387
388// GetInt returns a config value as an int.
389func (c *LiveConfig) GetInt(ns, key string) (int, error) {
390 nskey := nskey(ns, key)
391 val := viper.GetInt(nskey)
392
393 if isRequired(nskey) && val == 0 {
394 return 0, NewMissingArgsErr(nskey)
395 }
396 return val, nil
397}
398
399// GetIntPtr returns a config value as an int pointer.
400func (c *LiveConfig) GetIntPtr(ns, key string) (*int, error) {

Callers

nothing calls this directly

Calls 4

nskeyFunction · 0.85
isRequiredFunction · 0.85
NewMissingArgsErrFunction · 0.85
GetIntMethod · 0.65

Tested by

no test coverage detected