forked from TrueCloudLab/rclone
lib/rest: remove unnecessary nil check
From the Go docs: "A `nil` map is equivalent to an empty map. [1] Therefore, an additional nil check for `opts.ExtraHeaders` before the loop is unnecessary because `opts.ExtraHeaders` is a `map`. [1]: https://go.dev/ref/spec#Map_types Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
40de89df73
commit
c4bad5c1bc
1 changed files with 2 additions and 4 deletions
|
@ -275,11 +275,9 @@ func (api *Client) Call(ctx context.Context, opts *Opts) (resp *http.Response, e
|
||||||
req.Close = true
|
req.Close = true
|
||||||
}
|
}
|
||||||
// Set any extra headers
|
// Set any extra headers
|
||||||
if opts.ExtraHeaders != nil {
|
|
||||||
for k, v := range opts.ExtraHeaders {
|
for k, v := range opts.ExtraHeaders {
|
||||||
headers[k] = v
|
headers[k] = v
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// add any options to the headers
|
// add any options to the headers
|
||||||
fs.OpenOptionAddHeaders(opts.Options, headers)
|
fs.OpenOptionAddHeaders(opts.Options, headers)
|
||||||
// Now set the headers
|
// Now set the headers
|
||||||
|
|
Loading…
Add table
Reference in a new issue