Hi Rich,

I guess, you run into the behavior described here 
<https://pkg.go.dev/cmd/go#hdr-Remote_import_paths>:


*> To declare the code location, an import path of the form>     *
repository.vcs/path
*> specifies the given repository, with or without the .vcs suffix, using 
the named version control system, and then the path inside that repository.*
*> (...)*
*> If the import path is not a known code hosting site and also lacks a 
version control qualifier, the go tool attempts to fetch the import over 
https/http and looks for a <meta> tag in the document's HTML <head>. *
(emphasis mine)

So it seems the go get command does not recognize the import path to be a 
Git repository. Otherwise it would have tried SSH, too.

I would try changing the import path to 
repository.web.mycompany.com/st_nsres.git to give go get a hint that the 
import path is a Git repo.

On Saturday, September 24, 2022 at 1:14:45 AM UTC+2 Rich wrote:

> Sorry the last line was messed up.
>
> The error I get is:
>  github.com/stretchr/testify/require: 
> repository.web.mycompany.com/st_nsres@     v0.2.0: unrecognized import 
> path "repository.web.mycompany.com/st_nsres":       https fetch: Get "
> https://repository.web.mycompany.com/st_nsres?go-get=1":      Unable to 
> connect
>
> It keeps trying to connect via https -- IT's SSH
> Again I have ~/.gitconfig configured:
>
> [url "ssh://g...@internal.repository.web.mycompany.com:7999/ 
> <http://g...@internal.repository.web.mycompany.com:7999/>"]
>      insteadOf = https://repository.web.mycompany.com/
>
> And GOPRIVATE set to repository.web.mycompany.com
> On Friday, September 23, 2022 at 4:59:44 PM UTC-4 Rich wrote:
>
>> I have been having a really hard time with Go Get It just isn't working. 
>> We have a private Repositiory, that repository requires us to use SSH. 
>> There is no option for using https.
>>
>> So, I've configured my git config "~/.gitconfig' 
>>
>> ```
>> [url "ssh://g...@internal.repository.web.mycompany.com:7999/ 
>> <http://g...@internal.repository.web.mycompany.com:7999/>"]
>>      insteadOf = https://repository.web.mycompany.com/
>> ```
>> I have GOPRIVATE set
>> ```
>> export GOPRIVATE="repository.web.mycompany.com"
>> ```
>> Then when I use go get:
>> ```
>> repository.web.mycompany.com
>> ```
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/daedf690-ce4f-4c10-8d82-878b1072f606n%40googlegroups.com.

Reply via email to