ShouldUseExpiring resolves whether to prefer expiring credentials that gh refreshes automatically. An explicit --expiring flag value wins; when the flag is unset it falls back to the expiring_credentials config setting for the host.
(cfg gh.Config, flagValue *bool, hostname string)
| 72 | // --expiring flag value wins; when the flag is unset it falls back to the expiring_credentials config setting |
| 73 | // for the host. |
| 74 | func ShouldUseExpiring(cfg gh.Config, flagValue *bool, hostname string) bool { |
| 75 | if flagValue != nil { |
| 76 | return *flagValue |
| 77 | } |
| 78 | return cfg.ExpiringCredentials(hostname).Value == "enabled" |
| 79 | } |
| 80 | |
| 81 | func Login(opts *LoginOptions) error { |
| 82 | cfg := opts.Config |