MCPcopy Create free account
hub / github.com/cli/cli / get

Method get

internal/config/config.go:55–69  ·  view source on GitHub ↗
(hostname, key string)

Source from the content-addressed store, hash-verified

53}
54
55func (c *cfg) get(hostname, key string) o.Option[string] {
56 if hostname != "" {
57 val, err := c.cfg.Get([]string{hostsKey, hostname, key})
58 if err == nil {
59 return o.Some(val)
60 }
61 }
62
63 val, err := c.cfg.Get([]string{key})
64 if err == nil {
65 return o.Some(val)
66 }
67
68 return o.None[string]()
69}
70
71func (c *cfg) GetOrDefault(hostname, key string) o.Option[gh.ConfigEntry] {
72 if val := c.get(hostname, key); val.IsSome() {

Callers 3

GetOrDefaultMethod · 0.95
VersionMethod · 0.95
GetImageDigestMethod · 0.80

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected