From 9a25d46e8b5c079d97b909bb6e0bc1c1399c3e8c Mon Sep 17 00:00:00 2001 From: xichengliudui Date: Tue, 13 Nov 2018 03:28:31 -0500 Subject: [PATCH] Delete some redundant code Delete some redundant code --- staging/src/k8s.io/client-go/rest/request.go | 3 +-- staging/src/k8s.io/client-go/rest/request_test.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/staging/src/k8s.io/client-go/rest/request.go b/staging/src/k8s.io/client-go/rest/request.go index 64901fba20d..9609f01a504 100644 --- a/staging/src/k8s.io/client-go/rest/request.go +++ b/staging/src/k8s.io/client-go/rest/request.go @@ -1195,7 +1195,6 @@ func IsValidPathSegmentPrefix(name string) []string { func ValidatePathSegmentName(name string, prefix bool) []string { if prefix { return IsValidPathSegmentPrefix(name) - } else { - return IsValidPathSegmentName(name) } + return IsValidPathSegmentName(name) } diff --git a/staging/src/k8s.io/client-go/rest/request_test.go b/staging/src/k8s.io/client-go/rest/request_test.go index a415f60ae79..e70770dcd6e 100755 --- a/staging/src/k8s.io/client-go/rest/request_test.go +++ b/staging/src/k8s.io/client-go/rest/request_test.go @@ -1218,10 +1218,9 @@ func TestBackoffLifecycle(t *testing.T) { if count == 5 || count == 9 { w.WriteHeader(http.StatusOK) return - } else { - w.WriteHeader(http.StatusGatewayTimeout) - return } + w.WriteHeader(http.StatusGatewayTimeout) + return })) defer testServer.Close() c := testRESTClient(t, testServer)