github
87 of 192 new or added lines in 16 files covered. (45.31%)
4 existing lines in 3 files now uncovered.10476 of 14215 relevant lines covered (73.7%)
4.82 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
|
} |
× |