Skip to content

Commit cbfb18a

Browse files
committed
httpclient: use updateflag.Value instead of global access
1 parent 95a29c8 commit cbfb18a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

httpclient/instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/gokrazy/internal/updateflag"
1111
)
1212

13-
func For(cfg *config.Struct) (_ *http.Client, foundMatchingCertificate bool, updateBaseURL *url.URL, _ error) {
13+
func For(updateVal updateflag.Value, cfg *config.Struct) (_ *http.Client, foundMatchingCertificate bool, updateBaseURL *url.URL, _ error) {
1414
schema := "http"
1515
certPath, _, err := tlsflag.CertificatePathsFor(cfg.Hostname)
1616
if err != nil {
@@ -37,7 +37,7 @@ func For(cfg *config.Struct) (_ *http.Client, foundMatchingCertificate bool, upd
3737
update.Hostname = cfg.Hostname
3838
}
3939

40-
updateBaseURL, err = updateflag.BaseURL(update.HTTPPort, update.HTTPSPort, schema, update.Hostname, update.HTTPPassword)
40+
updateBaseURL, err = updateVal.BaseURL(update.HTTPPort, update.HTTPSPort, schema, update.Hostname, update.HTTPPassword)
4141
if err != nil {
4242
return nil, false, nil, err
4343
}

0 commit comments

Comments
 (0)