From 44bfb992f48d54905c48b38997b3e39b103af277 Mon Sep 17 00:00:00 2001 From: Shengwen YU Date: Tue, 21 Jun 2022 16:56:36 +0800 Subject: [PATCH] fix: update code for golangci-lint varcheck (#17045) Signed-off-by: Shengwen Yu --- src/.golangci.yaml | 2 +- src/pkg/reg/adapter/aliacr/types.go | 5 ++--- src/pkg/reg/adapter/tencentcr/adapter.go | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/.golangci.yaml b/src/.golangci.yaml index afaf6a395..624093bb6 100644 --- a/src/.golangci.yaml +++ b/src/.golangci.yaml @@ -41,7 +41,7 @@ linters: # - unconvert # - unparam # - unused - # - varcheck + - varcheck run: skip-files: diff --git a/src/pkg/reg/adapter/aliacr/types.go b/src/pkg/reg/adapter/aliacr/types.go index 0954d5a0b..f667f5279 100644 --- a/src/pkg/reg/adapter/aliacr/types.go +++ b/src/pkg/reg/adapter/aliacr/types.go @@ -3,9 +3,8 @@ package aliacr import "time" const ( - defaultTemporaryTokenExpiredTime = time.Hour * 1 // nolint:deadcode - registryEndpointTpl = "https://registry.%s.aliyuncs.com" - endpointTpl = "cr.%s.aliyuncs.com" + registryEndpointTpl = "https://registry.%s.aliyuncs.com" + endpointTpl = "cr.%s.aliyuncs.com" ) type authorizationToken struct { diff --git a/src/pkg/reg/adapter/tencentcr/adapter.go b/src/pkg/reg/adapter/tencentcr/adapter.go index dbf159d31..2ec9e6ba9 100644 --- a/src/pkg/reg/adapter/tencentcr/adapter.go +++ b/src/pkg/reg/adapter/tencentcr/adapter.go @@ -24,8 +24,7 @@ import ( ) var ( - errInvalidTcrEndpoint error = errors.New("[tencent-tcr.newAdapter] Invalid TCR instance endpoint") - errPingTcrEndpointFailed error = errors.New("[tencent-tcr.newAdapter] Ping TCR instance endpoint failed") // nolint:deadcode + errInvalidTcrEndpoint error = errors.New("[tencent-tcr.newAdapter] Invalid TCR instance endpoint") ) func init() {