google: restore compatibility with older Go version

Change-Id: Ib4d9d569b8ee50a9e5a86ff63061d976a111a070
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/425094
Auto-Submit: Cody Oss <codyoss@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
Run-TryBot: Cody Oss <codyoss@google.com>
This commit is contained in:
Cody Oss 2022-08-22 14:10:14 -05:00 committed by Gopher Robot
parent 8227340efa
commit 0ebed06d00
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"regexp" "regexp"
@ -253,7 +254,7 @@ func (cs executableCredentialSource) getTokenFromOutputFile() (token string, err
} }
defer file.Close() defer file.Close()
data, err := io.ReadAll(io.LimitReader(file, 1<<20)) data, err := ioutil.ReadAll(io.LimitReader(file, 1<<20))
if err != nil || len(data) == 0 { if err != nil || len(data) == 0 {
// Cachefile exists, but no data found. Get new credential. // Cachefile exists, but no data found. Get new credential.
return "", nil return "", nil