staticcheck: use result of type assertion to simplify cases

This commit is contained in:
albertony 2022-06-24 16:01:19 +02:00
parent 060c8dfff0
commit 0772cae314
3 changed files with 9 additions and 9 deletions

View file

@ -59,11 +59,11 @@ func (h *ReOpen) open() error {
var hashOption *fs.HashesOption
var rangeOption *fs.RangeOption
for _, option := range h.options {
switch option.(type) {
switch option := option.(type) {
case *fs.HashesOption:
hashOption = option.(*fs.HashesOption)
hashOption = option
case *fs.RangeOption:
rangeOption = option.(*fs.RangeOption)
rangeOption = option
case *fs.HTTPOption:
opts = append(opts, option)
default: