fix golint problem
This commit is contained in:
parent
0fc311a8b7
commit
c9fc6b5bcf
|
|
@ -27,12 +27,12 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
gitPullMethodEnvKey = "GIT_PULL_METHOD"
|
gitPullMethodEnvKey = "GIT_PULL_METHOD"
|
||||||
gitPullMethodHttps = "https"
|
gitPullMethodHTTPS = "https"
|
||||||
gitPullMethodHttp = "http"
|
gitPullMethodHTTP = "http"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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.
|
// Git unifies calls to download and unpack the build context.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ func TestGetGitPullMethod(t *testing.T) {
|
||||||
{
|
{
|
||||||
testName: "noEnv",
|
testName: "noEnv",
|
||||||
setEnv: func() (expectedValue string) {
|
setEnv: func() (expectedValue string) {
|
||||||
expectedValue = gitPullMethodHttps
|
expectedValue = gitPullMethodHTTPS
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -23,18 +23,18 @@ func TestGetGitPullMethod(t *testing.T) {
|
||||||
testName: "emptyEnv",
|
testName: "emptyEnv",
|
||||||
setEnv: func() (expectedValue string) {
|
setEnv: func() (expectedValue string) {
|
||||||
_ = os.Setenv(gitPullMethodEnvKey, "")
|
_ = os.Setenv(gitPullMethodEnvKey, "")
|
||||||
expectedValue = gitPullMethodHttps
|
expectedValue = gitPullMethodHTTPS
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
testName: "httpEnv",
|
testName: "httpEnv",
|
||||||
setEnv: func() (expectedValue string) {
|
setEnv: func() (expectedValue string) {
|
||||||
err := os.Setenv(gitPullMethodEnvKey, gitPullMethodHttp)
|
err := os.Setenv(gitPullMethodEnvKey, gitPullMethodHTTP)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
expectedValue = gitPullMethodHttps
|
expectedValue = gitPullMethodHTTPS
|
||||||
} else {
|
} else {
|
||||||
expectedValue = gitPullMethodHttp
|
expectedValue = gitPullMethodHTTP
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
|
|
@ -42,8 +42,8 @@ func TestGetGitPullMethod(t *testing.T) {
|
||||||
{
|
{
|
||||||
testName: "httpsEnv",
|
testName: "httpsEnv",
|
||||||
setEnv: func() (expectedValue string) {
|
setEnv: func() (expectedValue string) {
|
||||||
_ = os.Setenv(gitPullMethodEnvKey, gitPullMethodHttps)
|
_ = os.Setenv(gitPullMethodEnvKey, gitPullMethodHTTPS)
|
||||||
expectedValue = gitPullMethodHttps
|
expectedValue = gitPullMethodHTTPS
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -51,7 +51,7 @@ func TestGetGitPullMethod(t *testing.T) {
|
||||||
testName: "unknownEnv",
|
testName: "unknownEnv",
|
||||||
setEnv: func() (expectedValue string) {
|
setEnv: func() (expectedValue string) {
|
||||||
_ = os.Setenv(gitPullMethodEnvKey, "unknown")
|
_ = os.Setenv(gitPullMethodEnvKey, "unknown")
|
||||||
expectedValue = gitPullMethodHttps
|
expectedValue = gitPullMethodHTTPS
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue