From 0ebed06d00948a7aee9a5490123450d895686784 Mon Sep 17 00:00:00 2001 From: Cody Oss Date: Mon, 22 Aug 2022 14:10:14 -0500 Subject: [PATCH] google: restore compatibility with older Go version Change-Id: Ib4d9d569b8ee50a9e5a86ff63061d976a111a070 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/425094 Auto-Submit: Cody Oss TryBot-Result: Gopher Robot Reviewed-by: Tyler Bui-Palsulich Run-TryBot: Cody Oss --- google/internal/externalaccount/executablecredsource.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google/internal/externalaccount/executablecredsource.go b/google/internal/externalaccount/executablecredsource.go index 7e8f85b..579bcce 100644 --- a/google/internal/externalaccount/executablecredsource.go +++ b/google/internal/externalaccount/executablecredsource.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "os" "os/exec" "regexp" @@ -253,7 +254,7 @@ func (cs executableCredentialSource) getTokenFromOutputFile() (token string, err } 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 { // Cachefile exists, but no data found. Get new credential. return "", nil