feat(go): IO layer behind interfaces (M4) #13

Merged
kacerr merged 4 commits from feat/m4-io-layer into main 2026-05-07 10:48:54 +02:00
Showing only changes of commit 8275db1a63 - Show all commits

View File

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