Adjust the import package order and use http library variables (#9587)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
parent
fbdbc24a42
commit
1cdd61fb94
6 changed files with 7 additions and 7 deletions
|
|
@ -26,7 +26,7 @@ func (f *Framework) VerifyHealthz(ip string, statusCode int) error {
|
|||
url := fmt.Sprintf("http://%v:10254/healthz", ip)
|
||||
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating GET request for URL %q failed: %v", url, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ func (f *Framework) GetMetric(metricName, ip string) (*dto.MetricFamily, error)
|
|||
url := fmt.Sprintf("http://%v:10254/metrics", ip)
|
||||
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("creating GET request for URL %q failed: %v", url, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue