From 3435bf7f34ed0f7821d4119630496ad91427378f Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 24 Jun 2022 15:52:30 +0200 Subject: [PATCH] staticcheck: no value of type int64 is greater than math.MaxInt64 --- backend/union/upstream/upstream.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/backend/union/upstream/upstream.go b/backend/union/upstream/upstream.go index 06f3b9014..35b477f79 100644 --- a/backend/union/upstream/upstream.go +++ b/backend/union/upstream/upstream.go @@ -320,11 +320,7 @@ func (f *Fs) GetFreeSpace() (int64, error) { if f.usage.Free == nil { return math.MaxInt64 - 1, ErrUsageFieldNotSupported } - free := *f.usage.Free - if free >= math.MaxInt64 { - free = math.MaxInt64 - 1 - } - return free, nil + return *f.usage.Free, nil } // GetUsedSpace get the used space of the fs @@ -342,11 +338,7 @@ func (f *Fs) GetUsedSpace() (int64, error) { if f.usage.Used == nil { return 0, ErrUsageFieldNotSupported } - used := *f.usage.Used - if used >= math.MaxInt64 { - used = math.MaxInt64 - 1 - } - return used, nil + return *f.usage.Used, nil } // GetNumObjects get the number of objects of the fs