From d16feb8435f7145a5f33960e42e36b3767f182fb Mon Sep 17 00:00:00 2001 From: Patrick Jones Date: Fri, 8 Jan 2021 12:35:24 -0800 Subject: [PATCH] Fixed style nit. Change-Id: I1cd741935fd5e4b7fca70395285f8e458c6e0ae3 --- google/internal/externalaccount/filecredsource.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/google/internal/externalaccount/filecredsource.go b/google/internal/externalaccount/filecredsource.go index 67d37b9..a7b5439 100644 --- a/google/internal/externalaccount/filecredsource.go +++ b/google/internal/externalaccount/filecredsource.go @@ -37,16 +37,15 @@ func (cs fileCredentialSource) subjectToken() (string, error) { if err != nil { return "", fmt.Errorf("oauth2/google: failed to unmarshal subject token file: %v", err) } - if val, ok := jsonData[cs.Format.SubjectTokenFieldName]; !ok { + val, ok := jsonData[cs.Format.SubjectTokenFieldName] + if !ok { return "", errors.New("oauth2/google: provided subject_token_field_name not found in credentials") - } else { - token, ok := val.(string) - if !ok { - return "", errors.New("oauth2/google: improperly formatted subject token") - } - output = token - } + token, ok := val.(string) + if !ok { + return "", errors.New("oauth2/google: improperly formatted subject token") + } + output = token case "text": output = string(tokenBytes) case "":