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

Method Set

internal/config/config.go:96–107  ·  view source on GitHub ↗
(hostname, key, value string)

Source from the content-addressed store, hash-verified

94}
95
96func (c *cfg) Set(hostname, key, value string) {
97 if hostname == "" {
98 c.cfg.Set([]string{key}, value)
99 return
100 }
101
102 c.cfg.Set([]string{hostsKey, hostname, key}, value)
103
104 if user, _ := c.cfg.Get([]string{hostsKey, hostname, userKey}); user != "" {
105 c.cfg.Set([]string{hostsKey, hostname, usersKey, user, key}, value)
106 }
107}
108
109func (c *cfg) Write() error {
110 return ghConfig.Write(c.cfg)

Callers 2

NewMockConfigFromStringFunction · 0.95
MigrateMethod · 0.95

Calls 2

SetMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected