testutil: use constants for http methods

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-12 20:43:17 +02:00
parent 23b6b5a9ae
commit a617809fe7
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 3 additions and 3 deletions

View File

@ -328,7 +328,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
Transport: clientConfig.transport,
}
req, err := http.NewRequest("GET", "/_ping", nil)
req, err := http.NewRequest(http.MethodGet, "/_ping", nil)
if err != nil {
return errors.Wrapf(err, "[%s] could not create new request", d.id)
}
@ -683,7 +683,7 @@ func (d *Daemon) queryRootDir() (string, error) {
Transport: clientConfig.transport,
}
req, err := http.NewRequest("GET", "/info", nil)
req, err := http.NewRequest(http.MethodGet, "/info", nil)
if err != nil {
return "", err
}

View File

@ -115,7 +115,7 @@ func newRequest(endpoint string, opts *Options) (*http.Request, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed parsing url %q", opts.host)
}
req, err := http.NewRequest("GET", endpoint, nil)
req, err := http.NewRequest(http.MethodGet, endpoint, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to create request")
}