github
144 of 196 new or added lines in 17 files covered. (73.47%)
4 existing lines in 3 files now uncovered.10537 of 14217 relevant lines covered (74.12%)
4.83 hits per line
1 |
package otelhttpclient
|
|
2 |
|
|
3 |
import (
|
|
4 |
"net/http"
|
|
5 |
) |
|
6 |
|
|
NEW
|
func New(name string, client *http.Client) *http.Client { |
× |
NEW
|
if client == nil { |
× |
NEW
|
return NewClient(name)
|
× |
NEW
|
} |
× |
NEW
|
return NewFromClient(client, name)
|
× |
12 |
} |
|
13 |
|
|
NEW
|
func NewClient(name string) *http.Client { |
× |
NEW
|
return &http.Client{
|
× |
NEW
|
Transport: NewHTTPTransport(nil, name),
|
× |
NEW
|
} |
× |
NEW
|
} |
× |
19 |
|
|
NEW
|
func NewFromClient(httpClient *http.Client, name string) *http.Client { |
× |
NEW
|
httpClient.Transport = NewHTTPTransport(httpClient.Transport, name) |
× |
NEW
|
return httpClient
|
× |
NEW
|
} |
× |