fix(io/transform/gsheet2csv): use safe defaults for http client

This commit is contained in:
AJ ONeal 2026-08-17 17:25:45 -06:00
parent c66c4a8de4
commit 484b6bc11a
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,5 @@
module github.com/therootcompany/golib/io/transform/gsheet2csv 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

View File

@ -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=

View File

@ -20,6 +20,8 @@ import (
"os" "os"
"strings" "strings"
"unicode/utf8" "unicode/utf8"
"github.com/therootcompany/golib/https"
) )
const ( const (
@ -31,8 +33,8 @@ const (
var ErrHTTPGet = errors.New("did not get 200 OK when downloading from URL") var ErrHTTPGet = errors.New("did not get 200 OK when downloading from URL")
// For mocking for tests var httpClient = https.NewDefaultClient()
var httpGet = http.Get var httpGet = httpClient.Get // since Get function is used and this allows mocking
type Reader struct { type Reader struct {
*csv.Reader *csv.Reader