Chore: add some linters and clean up the code

This commit is contained in:
Dreamacro
2023-04-04 14:53:59 +08:00
parent a7252a1576
commit 5045ca4574
8 changed files with 18 additions and 12 deletions

View File

@ -58,7 +58,7 @@ func (hc *httpConn) Write(b []byte) (int, error) {
}
u := fmt.Sprintf("http://%s%s", host, path)
req, _ := http.NewRequest("GET", u, bytes.NewBuffer(b))
req, _ := http.NewRequest(http.MethodGet, u, bytes.NewBuffer(b))
for key, list := range hc.cfg.Headers {
req.Header.Set(key, list[rand.Intn(len(list))])
}