From c9fc6b5bcfa9db57ed6656cb01030425cde05c19 Mon Sep 17 00:00:00 2001 From: yw-liu <43599588+yw-liu@users.noreply.github.com> Date: Fri, 17 Apr 2020 00:21:48 +0800 Subject: [PATCH] fix golint problem --- pkg/buildcontext/git.go | 6 +++--- pkg/buildcontext/git_test.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/buildcontext/git.go b/pkg/buildcontext/git.go index 291f834f6..931a07089 100644 --- a/pkg/buildcontext/git.go +++ b/pkg/buildcontext/git.go @@ -27,12 +27,12 @@ import ( const ( gitPullMethodEnvKey = "GIT_PULL_METHOD" - gitPullMethodHttps = "https" - gitPullMethodHttp = "http" + gitPullMethodHTTPS = "https" + gitPullMethodHTTP = "http" ) var ( - supportedGitPullMethods = map[string]bool{gitPullMethodHttps: true, gitPullMethodHttp: true} + supportedGitPullMethods = map[string]bool{gitPullMethodHTTPS: true, gitPullMethodHTTP: true} ) // Git unifies calls to download and unpack the build context. diff --git a/pkg/buildcontext/git_test.go b/pkg/buildcontext/git_test.go index 6f293a6ef..e165bd508 100644 --- a/pkg/buildcontext/git_test.go +++ b/pkg/buildcontext/git_test.go @@ -15,7 +15,7 @@ func TestGetGitPullMethod(t *testing.T) { { testName: "noEnv", setEnv: func() (expectedValue string) { - expectedValue = gitPullMethodHttps + expectedValue = gitPullMethodHTTPS return }, }, @@ -23,18 +23,18 @@ func TestGetGitPullMethod(t *testing.T) { testName: "emptyEnv", setEnv: func() (expectedValue string) { _ = os.Setenv(gitPullMethodEnvKey, "") - expectedValue = gitPullMethodHttps + expectedValue = gitPullMethodHTTPS return }, }, { testName: "httpEnv", setEnv: func() (expectedValue string) { - err := os.Setenv(gitPullMethodEnvKey, gitPullMethodHttp) + err := os.Setenv(gitPullMethodEnvKey, gitPullMethodHTTP) if nil != err { - expectedValue = gitPullMethodHttps + expectedValue = gitPullMethodHTTPS } else { - expectedValue = gitPullMethodHttp + expectedValue = gitPullMethodHTTP } return }, @@ -42,8 +42,8 @@ func TestGetGitPullMethod(t *testing.T) { { testName: "httpsEnv", setEnv: func() (expectedValue string) { - _ = os.Setenv(gitPullMethodEnvKey, gitPullMethodHttps) - expectedValue = gitPullMethodHttps + _ = os.Setenv(gitPullMethodEnvKey, gitPullMethodHTTPS) + expectedValue = gitPullMethodHTTPS return }, }, @@ -51,7 +51,7 @@ func TestGetGitPullMethod(t *testing.T) { testName: "unknownEnv", setEnv: func() (expectedValue string) { _ = os.Setenv(gitPullMethodEnvKey, "unknown") - expectedValue = gitPullMethodHttps + expectedValue = gitPullMethodHTTPS return }, },