From 83d080488e9c54eaaf149c8749d03fba91d4025c Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Wed, 18 Jan 2023 11:00:45 -0800 Subject: [PATCH] Use AuthToken function to retrieve AuthToken instead of GetOrDefault (#6878) --- pkg/cmd/auth/token/token.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/auth/token/token.go b/pkg/cmd/auth/token/token.go index 9dcc65e8d..c28d42d26 100644 --- a/pkg/cmd/auth/token/token.go +++ b/pkg/cmd/auth/token/token.go @@ -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") }