From 66660ffc8e47f3c17f232c7c904651de35128a50 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Sun, 12 Jan 2025 14:25:35 +0200 Subject: [PATCH] Avoid suggesting go Remote repositories as potential resolver repository in go-config (#1329) --- common/commands/configfile.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/commands/configfile.go b/common/commands/configfile.go index be496e997..d71455ead 100644 --- a/common/commands/configfile.go +++ b/common/commands/configfile.go @@ -494,7 +494,13 @@ func (configFile *ConfigFile) setResolver(withSnapshot bool) error { } // Set resolution repository if configFile.Resolver.ServerId != "" { - resolverRepos, err := getRepositories(configFile.Resolver.ServerId, utils.Virtual, utils.Remote) + repoTypes := []utils.RepoType{utils.Virtual} + if configFile.ConfigType != project.Go.String() { + // Go doesn't support resolving from Artifactory remote Go repositories. (https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-remote-go-repositories) + // To resolve dependencies from a Remote Go repository, you must nest the remote repository under a virtual Go repository. + repoTypes = append(repoTypes, utils.Remote) + } + resolverRepos, err := getRepositories(configFile.Resolver.ServerId, repoTypes...) if err != nil { log.Error("failed getting repositories list: " + err.Error()) // Continue without auto complete.