Use AuthToken function to retrieve AuthToken instead of GetOrDefault (#6878)

This commit is contained in:
Sam Coe 2023-01-18 11:00:45 -08:00 committed by GitHub
parent 55578208a6
commit 83d080488e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,9 +52,8 @@ func tokenRun(opts *TokenOptions) error {
return err
}
key := "oauth_token"
val, err := cfg.GetOrDefault(hostname, key)
if err != nil {
val, _ := cfg.AuthToken(hostname)
if val == "" {
return fmt.Errorf("no oauth token")
}