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

Method get

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

Source from the content-addressed store, hash-verified

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