From 9897f33f7da87ed5586bb4b98fcda769739d7775 Mon Sep 17 00:00:00 2001 From: Sakura Date: Thu, 23 Jan 2020 21:07:14 +0800 Subject: [PATCH] fix static check errors in vendor/k8s.io/apimachinery/pkg/api/resource Signed-off-by: Sakura --- hack/.staticcheck_failures | 1 - staging/src/k8s.io/apimachinery/pkg/api/resource/math.go | 8 ++------ .../k8s.io/apimachinery/pkg/api/resource/quantity_test.go | 5 ----- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index e2ddb3ac417..dcfda2b3351 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -48,7 +48,6 @@ test/integration/garbagecollector test/integration/scheduler_perf test/integration/ttlcontroller vendor/k8s.io/apimachinery/pkg/api/meta -vendor/k8s.io/apimachinery/pkg/api/resource vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation diff --git a/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go b/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go index 7f63175d3e5..8ffcb9f09ac 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go @@ -37,12 +37,8 @@ var ( big1024 = big.NewInt(1024) // Commonly needed inf.Dec values-- treat as read only! - decZero = inf.NewDec(0, 0) - decOne = inf.NewDec(1, 0) - decMinusOne = inf.NewDec(-1, 0) - decThousand = inf.NewDec(1000, 0) - dec1024 = inf.NewDec(1024, 0) - decMinus1024 = inf.NewDec(-1024, 0) + decZero = inf.NewDec(0, 0) + decOne = inf.NewDec(1, 0) // Largest (in magnitude) number allowed. maxAllowed = infDecAmount{inf.NewDec((1<<63)-1, 0)} // == max int64 diff --git a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go b/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go index e6515f2bec5..1401a83bbcf 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go @@ -28,11 +28,6 @@ import ( inf "gopkg.in/inf.v0" ) -func amount(i int64, exponent int) infDecAmount { - // See the below test-- scale is the negative of an exponent. - return infDecAmount{inf.NewDec(i, inf.Scale(-exponent))} -} - func dec(i int64, exponent int) infDecAmount { // See the below test-- scale is the negative of an exponent. return infDecAmount{inf.NewDec(i, inf.Scale(-exponent))}