From 484b6bc11a34d37b6a55bdb136886b02e58ffd95 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 17 Aug 2026 17:25:45 -0600 Subject: [PATCH] fix(io/transform/gsheet2csv): use safe defaults for http client --- io/transform/gsheet2csv/go.mod | 4 +++- io/transform/gsheet2csv/go.sum | 2 ++ io/transform/gsheet2csv/gsheet2csv.go | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 io/transform/gsheet2csv/go.sum diff --git a/io/transform/gsheet2csv/go.mod b/io/transform/gsheet2csv/go.mod index f57d483..430b1c1 100644 --- a/io/transform/gsheet2csv/go.mod +++ b/io/transform/gsheet2csv/go.mod @@ -1,3 +1,5 @@ module github.com/therootcompany/golib/io/transform/gsheet2csv -go 1.24.6 +go 1.26.5 + +require github.com/therootcompany/golib/https v0.9.0 // indirect diff --git a/io/transform/gsheet2csv/go.sum b/io/transform/gsheet2csv/go.sum new file mode 100644 index 0000000..f0731b1 --- /dev/null +++ b/io/transform/gsheet2csv/go.sum @@ -0,0 +1,2 @@ +github.com/therootcompany/golib/https v0.9.0 h1:D9gh0K6ljkvF805JUbylITn8SHPMo08q5PglQGXsK8c= +github.com/therootcompany/golib/https v0.9.0/go.mod h1:ilExqR/Uh7oB36oy9mwuNhANcFh+zdCfD3uJiZ11YAY= diff --git a/io/transform/gsheet2csv/gsheet2csv.go b/io/transform/gsheet2csv/gsheet2csv.go index ac9d962..b48ab5c 100644 --- a/io/transform/gsheet2csv/gsheet2csv.go +++ b/io/transform/gsheet2csv/gsheet2csv.go @@ -20,6 +20,8 @@ import ( "os" "strings" "unicode/utf8" + + "github.com/therootcompany/golib/https" ) const ( @@ -31,8 +33,8 @@ const ( var ErrHTTPGet = errors.New("did not get 200 OK when downloading from URL") -// For mocking for tests -var httpGet = http.Get +var httpClient = https.NewDefaultClient() +var httpGet = httpClient.Get // since Get function is used and this allows mocking type Reader struct { *csv.Reader