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

Method GetIntPtr

doit.go:400–411  ·  view source on GitHub ↗

GetIntPtr returns a config value as an int pointer.

(ns, key string)

Source from the content-addressed store, hash-verified

398
399// GetIntPtr returns a config value as an int pointer.
400func (c *LiveConfig) GetIntPtr(ns, key string) (*int, error) {
401 nskey := nskey(ns, key)
402
403 if !c.IsSet(key) {
404 if isRequired(nskey) {
405 return nil, NewMissingArgsErr(nskey)
406 }
407 return nil, nil
408 }
409 val := viper.GetInt(nskey)
410 return &val, nil
411}
412
413// GetFloat64 returns a config value as a float64.
414func (c *LiveConfig) GetFloat64(ns, key string) (float64, error) {

Callers

nothing calls this directly

Calls 5

IsSetMethod · 0.95
nskeyFunction · 0.85
isRequiredFunction · 0.85
NewMissingArgsErrFunction · 0.85
GetIntMethod · 0.65

Tested by

no test coverage detected