MCPcopy Index your code
hub / github.com/cli/cli / get

Method get

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

Source from the content-addressed store, hash-verified

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