Use http constants instead of string (#5908)

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
Fish-pro
2023-02-09 19:29:49 +08:00
committed by GitHub
parent 055b2c31a9
commit 039a4d87e2
4 changed files with 7 additions and 7 deletions

View File

@@ -19,7 +19,6 @@
//
// result := Scrape("http://localhost:9153/metrics")
// v := MetricValue("coredns_cache_capacity", result)
//
package test
import (
@@ -217,7 +216,7 @@ func makeBuckets(m *dto.Metric) map[string]string {
func fetchMetricFamilies(url string, ch chan<- *dto.MetricFamily) {
defer close(ch)
req, err := http.NewRequest("GET", url, nil)
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return
}