mirror of
https://github.com/rclone/rclone.git
synced 2025-02-01 18:00:00 +08:00
staticcheck: no value of type int64 is greater than math.MaxInt64
This commit is contained in:
parent
0772cae314
commit
3435bf7f34
|
@ -320,11 +320,7 @@ func (f *Fs) GetFreeSpace() (int64, error) {
|
||||||
if f.usage.Free == nil {
|
if f.usage.Free == nil {
|
||||||
return math.MaxInt64 - 1, ErrUsageFieldNotSupported
|
return math.MaxInt64 - 1, ErrUsageFieldNotSupported
|
||||||
}
|
}
|
||||||
free := *f.usage.Free
|
return *f.usage.Free, nil
|
||||||
if free >= math.MaxInt64 {
|
|
||||||
free = math.MaxInt64 - 1
|
|
||||||
}
|
|
||||||
return free, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUsedSpace get the used space of the fs
|
// GetUsedSpace get the used space of the fs
|
||||||
|
@ -342,11 +338,7 @@ func (f *Fs) GetUsedSpace() (int64, error) {
|
||||||
if f.usage.Used == nil {
|
if f.usage.Used == nil {
|
||||||
return 0, ErrUsageFieldNotSupported
|
return 0, ErrUsageFieldNotSupported
|
||||||
}
|
}
|
||||||
used := *f.usage.Used
|
return *f.usage.Used, nil
|
||||||
if used >= math.MaxInt64 {
|
|
||||||
used = math.MaxInt64 - 1
|
|
||||||
}
|
|
||||||
return used, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetNumObjects get the number of objects of the fs
|
// GetNumObjects get the number of objects of the fs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user