Skip to content

Commit

Permalink
remove use of cleanhttp since it's not already in go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
jipperinbham committed Jan 4, 2024
1 parent e79d8da commit 86207ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
10 changes: 5 additions & 5 deletions flaps/flaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"time"

"github.com/azazeal/pause"
"github.com/hashicorp/go-cleanhttp"
"github.com/jpillora/backoff"
"github.com/superfly/flyctl/agent"
"github.com/superfly/flyctl/api"
Expand Down Expand Up @@ -87,7 +86,7 @@ func NewWithOptions(ctx context.Context, opts NewClientOpts) (*Client, error) {
logger = opts.Logger
}

transport := otelhttp.NewTransport(cleanhttp.DefaultTransport())
transport := otelhttp.NewTransport(http.DefaultTransport)
httpClient, err := api.NewHTTPClient(logger, transport)
if err != nil {
return nil, fmt.Errorf("flaps: can't setup HTTP client to %s: %w", flapsUrl.String(), err)
Expand Down Expand Up @@ -137,9 +136,10 @@ func newWithUsermodeWireguard(ctx context.Context, params wireguardConnectionPar
return nil, fmt.Errorf("flaps: can't build tunnel for %s: %w", params.orgSlug, err)
}

transport := cleanhttp.DefaultTransport()
transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
return dialer.DialContext(ctx, network, addr)
transport := &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
return dialer.DialContext(ctx, network, addr)
},
}
instrumentedTransport := otelhttp.NewTransport(transport)

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/haileys/go-harlog v0.0.0-20230517070437-0f99204b5a57
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-version v1.6.0
github.com/heroku/heroku-go/v5 v5.5.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ github.com/haileys/go-harlog v0.0.0-20230517070437-0f99204b5a57/go.mod h1:feJwxr
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
Expand Down
4 changes: 2 additions & 2 deletions internal/cmdutil/preparers/preparers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"errors"
"fmt"
"io/fs"
"net/http"
"os"
"path/filepath"
"strings"

"github.com/hashicorp/go-cleanhttp"
"github.com/spf13/pflag"
"github.com/superfly/flyctl/api"
"github.com/superfly/flyctl/client"
Expand Down Expand Up @@ -60,7 +60,7 @@ func InitClient(ctx context.Context) (context.Context, error) {
api.SetBaseURL(cfg.APIBaseURL)
api.SetErrorLog(cfg.LogGQLErrors)
api.SetInstrumenter(instrument.ApiAdapter)
api.SetTransport(otelhttp.NewTransport(cleanhttp.DefaultTransport()))
api.SetTransport(otelhttp.NewTransport(http.DefaultTransport))

c := client.FromTokens(cfg.Tokens)
logger.Debug("client initialized.")
Expand Down

0 comments on commit 86207ad

Please sign in to comment.