Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon committed Oct 28, 2024
1 parent ccefc3c commit 14f16df
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions pkg/opentelemetry/otelhttpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,10 @@ import (

func New(name string, client *http.Client) *http.Client {
if client == nil {
return NewClient(name)
return &http.Client{
Transport: NewHTTPTransport(nil, name),
}
}
return NewFromClient(client, name)
}

func NewClient(name string) *http.Client {
return &http.Client{
Transport: NewHTTPTransport(nil, name),
}
}

func NewFromClient(httpClient *http.Client, name string) *http.Client {
httpClient.Transport = NewHTTPTransport(httpClient.Transport, name)
return httpClient
client.Transport = NewHTTPTransport(client.Transport, name)
return client
}

0 comments on commit 14f16df

Please sign in to comment.