diff --git a/go/internal/io/fio/client.go b/go/internal/io/fio/client.go index 4ff3ae2..db40d54 100644 --- a/go/internal/io/fio/client.go +++ b/go/internal/io/fio/client.go @@ -4,6 +4,7 @@ package fio import ( "context" + "net/http" "time" ) @@ -29,7 +30,11 @@ type Client interface { } // New returns an apiClient when token is non-empty, otherwise a transparentClient. +// hc may be nil, in which case http.DefaultClient is used. func New(token, accountNum string, hc httpDoer) Client { + if hc == nil { + hc = http.DefaultClient + } if token != "" { return &apiClient{token: token, hc: hc} }