chore: linter: usestdlibvars

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2025-10-23 22:48:54 +02:00
parent d84280107c
commit c883f49a24
11 changed files with 21 additions and 18 deletions
+3 -3
View File
@@ -173,7 +173,7 @@ func (p *Process) Get(path string) ([]byte, error) {
}
url := fmt.Sprintf("http://%s%s", p.addr, path)
req, err := http.NewRequest("GET", url, nil)
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
@@ -198,7 +198,7 @@ func (p *Process) Post(path string, data io.Reader) ([]byte, error) {
},
}
url := fmt.Sprintf("http://%s%s", p.addr, path)
req, err := http.NewRequest("POST", url, data)
req, err := http.NewRequest(http.MethodPost, url, data)
if err != nil {
return nil, err
}
@@ -397,7 +397,7 @@ func (*Process) readResponse(resp *http.Response) ([]byte, error) {
if err != nil {
return bs, err
}
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
return bs, errors.New(resp.Status)
}
return bs, nil