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

Method ActiveUser

internal/config/config.go:333–335  ·  view source on GitHub ↗

ActiveUser will retrieve the username for the active user at the given hostname. This will not be accurate if the oauth token is set from an environment variable.

(hostname string)

Source from the content-addressed store, hash-verified

331// ActiveUser will retrieve the username for the active user at the given hostname.
332// This will not be accurate if the oauth token is set from an environment variable.
333func (c *AuthConfig) ActiveUser(hostname string) (string, error) {
334 return c.cfg.Get([]string{hostsKey, hostname, userKey})
335}
336
337func (c *AuthConfig) Hosts() []string {
338 if c.hostsOverride != nil {

Callers 3

ActiveTokenMethod · 0.95
SwitchUserMethod · 0.95
LogoutMethod · 0.95

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected