From 044e297413066262c54beb33e98d0e498178897b Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 21 Jul 2026 14:23:40 +0200 Subject: use http.MethodFoo constants where possible --- account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'account.go') diff --git a/account.go b/account.go index d783baf..12d4d75 100644 --- a/account.go +++ b/account.go @@ -105,7 +105,7 @@ func (a *Account) Headers(ctx context.Context) (AccountHeaders, error) { } resp, err := Request{ - Method: "HEAD", + Method: http.MethodHead, ExpectStatusCodes: []int{204}, }.Do(ctx, a.backend) if err != nil { @@ -136,7 +136,7 @@ func (a *Account) Invalidate() { // A successful POST request implies Invalidate() since it may change metadata. func (a *Account) Update(ctx context.Context, headers AccountHeaders, opts *RequestOptions) error { resp, err := Request{ - Method: "POST", + Method: http.MethodPost, Options: cloneRequestOptions(opts, headers.Headers), ExpectStatusCodes: []int{204}, }.Do(ctx, a.backend) @@ -153,7 +153,7 @@ func (a *Account) Update(ctx context.Context, headers AccountHeaders, opts *Requ // A successful PUT request implies Invalidate() since it may change metadata. func (a *Account) Create(ctx context.Context, opts *RequestOptions) error { resp, err := Request{ - Method: "PUT", + Method: http.MethodPut, Options: opts, ExpectStatusCodes: []int{201, 202}, DrainResponseBody: true, -- cgit v1.3.1