Skip to content

Commit 850067c

Browse files
committed
getDeviceToken: return error instead of calling Fatalln()
the call site in main() exits on error, so this seems unnecessary here
1 parent 378e609 commit 850067c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ func getToken(ctx context.Context, c oauth2.Config, authURLSuffix string) (*oaut
494494
func getDeviceToken(ctx context.Context, c oauth2.Config) (*oauth2.Token, error) {
495495
deviceAuth, err := c.DeviceAuth(ctx)
496496
if err != nil {
497-
log.Fatalln(err)
497+
return nil, err
498498
}
499499
if verbose {
500500
fmt.Fprintf(os.Stderr, "%+v\n", deviceAuth)

0 commit comments

Comments
 (0)