diff --git a/artifactory/commands/buildtoollogin/buildtoollogin.go b/artifactory/commands/buildtoollogin/buildtoollogin.go index 24cb45212..babdab348 100644 --- a/artifactory/commands/buildtoollogin/buildtoollogin.go +++ b/artifactory/commands/buildtoollogin/buildtoollogin.go @@ -3,6 +3,7 @@ package buildtoollogin import ( "fmt" biutils "github.com/jfrog/build-info-go/utils" + gocommands "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/golang" pythoncommands "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/python" "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/repository" commandsutils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils" @@ -11,7 +12,6 @@ import ( "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/yarn" "github.com/jfrog/jfrog-cli-core/v2/common/project" "github.com/jfrog/jfrog-cli-core/v2/utils/config" - goutils "github.com/jfrog/jfrog-cli-core/v2/utils/golang" "github.com/jfrog/jfrog-client-go/artifactory/services" "github.com/jfrog/jfrog-client-go/utils/errorutils" "github.com/jfrog/jfrog-client-go/utils/log" @@ -200,7 +200,7 @@ func (btlc *BuildToolLoginCommand) configureYarn() error { // // go env -w GOPROXY=https://:@/artifactory/go/,direct func (btlc *BuildToolLoginCommand) configureGo() error { - repoWithCredsUrl, err := goutils.GetArtifactoryRemoteRepoUrl(btlc.serverDetails, btlc.repoName, goutils.GoProxyUrlParams{Direct: true}) + repoWithCredsUrl, err := gocommands.GetArtifactoryRemoteRepoUrl(btlc.serverDetails, btlc.repoName, gocommands.GoProxyUrlParams{Direct: true}) if err != nil { return err } diff --git a/artifactory/commands/golang/go.go b/artifactory/commands/golang/go.go index 6671589c7..39ac40ae1 100644 --- a/artifactory/commands/golang/go.go +++ b/artifactory/commands/golang/go.go @@ -154,7 +154,7 @@ func (gc *GoCommand) run() (err error) { return } // If noFallback=false, missing packages will be fetched directly from VCS - repoUrl, err := getArtifactoryRemoteRepoUrl(resolverDetails, gc.resolverParams.TargetRepo(), GoProxyUrlParams{Direct: !gc.noFallback}) + repoUrl, err := GetArtifactoryRemoteRepoUrl(resolverDetails, gc.resolverParams.TargetRepo(), GoProxyUrlParams{Direct: !gc.noFallback}) if err != nil { return } @@ -336,7 +336,7 @@ func SetArtifactoryAsResolutionServer(serverDetails *config.ServerDetails, depsR } func setGoProxy(server *config.ServerDetails, remoteGoRepo string, goProxyParams GoProxyUrlParams) error { - repoUrl, err := getArtifactoryRemoteRepoUrl(server, remoteGoRepo, goProxyParams) + repoUrl, err := GetArtifactoryRemoteRepoUrl(server, remoteGoRepo, goProxyParams) if err != nil { return err } @@ -380,7 +380,7 @@ func (gdu *GoProxyUrlParams) addDirect(url string) string { return url } -func getArtifactoryRemoteRepoUrl(serverDetails *config.ServerDetails, repo string, goProxyParams GoProxyUrlParams) (string, error) { +func GetArtifactoryRemoteRepoUrl(serverDetails *config.ServerDetails, repo string, goProxyParams GoProxyUrlParams) (string, error) { authServerDetails, err := serverDetails.CreateArtAuthConfig() if err != nil { return "", err diff --git a/artifactory/commands/golang/go_test.go b/artifactory/commands/golang/go_test.go index 7949b3062..7b334a3fe 100644 --- a/artifactory/commands/golang/go_test.go +++ b/artifactory/commands/golang/go_test.go @@ -86,7 +86,7 @@ func TestGetArtifactoryRemoteRepoUrl(t *testing.T) { AccessToken: "eyJ0eXAiOiJKV1QifQ.eyJzdWIiOiJmYWtlXC91c2Vyc1wvdGVzdCJ9.MTIzNDU2Nzg5MA", } repoName := "test-repo" - repoUrl, err := getArtifactoryRemoteRepoUrl(server, repoName, GoProxyUrlParams{}) + repoUrl, err := GetArtifactoryRemoteRepoUrl(server, repoName, GoProxyUrlParams{}) assert.NoError(t, err) assert.Equal(t, "https://test:eyJ0eXAiOiJKV1QifQ.eyJzdWIiOiJmYWtlXC91c2Vyc1wvdGVzdCJ9.MTIzNDU2Nzg5MA@server.com/artifactory/api/go/test-repo", repoUrl) } diff --git a/artifactory/utils/npm/config-delete.go b/artifactory/utils/npm/config-delete.go index 9c4c1f289..bcd8467e7 100644 --- a/artifactory/utils/npm/config-delete.go +++ b/artifactory/utils/npm/config-delete.go @@ -2,7 +2,6 @@ package npm import ( gofrogcmd "github.com/jfrog/gofrog/io" - npmutils "github.com/jfrog/jfrog-cli-core/v2/utils/npm" "github.com/jfrog/jfrog-client-go/utils/errorutils" ) @@ -15,8 +14,8 @@ func ConfigDelete(key, executablePath string) error { return nil } -func createConfigDeleteCmdConfig(executablePath, key string) *npmutils.NpmConfig { - return &npmutils.NpmConfig{ +func createConfigDeleteCmdConfig(executablePath, key string) *NpmConfig { + return &NpmConfig{ Npm: executablePath, Command: []string{"config", "delete", key}, StrWriter: nil, diff --git a/artifactory/utils/npm/config-set.go b/artifactory/utils/npm/config-set.go index 1df8431d8..c80c9c53c 100644 --- a/artifactory/utils/npm/config-set.go +++ b/artifactory/utils/npm/config-set.go @@ -2,7 +2,6 @@ package npm import ( gofrogcmd "github.com/jfrog/gofrog/io" - npmutils "github.com/jfrog/jfrog-cli-core/v2/utils/npm" "github.com/jfrog/jfrog-client-go/utils/errorutils" ) @@ -15,8 +14,8 @@ func ConfigSet(key, value, executablePath string) error { return nil } -func createConfigSetCmdConfig(executablePath, key, value string) *npmutils.NpmConfig { - return &npmutils.NpmConfig{ +func createConfigSetCmdConfig(executablePath, key, value string) *NpmConfig { + return &NpmConfig{ Npm: executablePath, Command: []string{"config", "set", key, value}, StrWriter: nil,