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

Method Set

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

Source from the content-addressed store, hash-verified

92}
93
94func (c *cfg) Set(hostname, key, value string) {
95 if hostname == "" {
96 c.cfg.Set([]string{key}, value)
97 return
98 }
99
100 c.cfg.Set([]string{hostsKey, hostname, key}, value)
101
102 if user, _ := c.cfg.Get([]string{hostsKey, hostname, userKey}); user != "" {
103 c.cfg.Set([]string{hostsKey, hostname, usersKey, user, key}, value)
104 }
105}
106
107func (c *cfg) Write() error {
108 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