Go Mod SSH doesn't work

294 views
Skip to first unread message

Rich

unread,
Aug 5, 2022, 9:22:47 AM8/5/22
to golang-nuts
Go modules have been frustrating working with internal sites that use ssh.  There is NO option to use HTTP. THere is no option to use a proxy. So I set up my go mod to contain 

go.mod file:
require 

.gitconfig file:

go env:
go env -w GOPRIVATE=codecloud.web.att.com/*
(I've tried the full path here and I get the same error)

ERROR:

I really don't get why this is so $#@! hard and not some simple setting in go.mod like this:

require 
    private git@ssh://codecloud.web.mycompany.com/devgroup/mypackage v1.0.0 

-- but it's broken, it doesn't work, and I am out of what to google next. 

Thomas Bushnell BSG

unread,
Aug 5, 2022, 10:18:38 AM8/5/22
to Rich, golang-nuts
I'm confused; while I haven't used that sort of setup, the documentation does seem to address the case.


I can't tell from what you're saying whether you're using those facilities or not, but that's where I'd look.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/cf2ef966-3bc5-4e81-89be-c130c624786fn%40googlegroups.com.

Rich

unread,
Aug 5, 2022, 2:14:13 PM8/5/22
to golang-nuts
Thomas -- thank you for taking the time to reply.

This is one of the BIGGEST headaches coming from another language is Go Mod, and for a language that brags about being simple, fast to write, and fast to compile -- well I can't compile it if go mod can't download it -- even though it's right there in my GOPATH! Simple? The documentation on Go Mod is as extensive as 'Effective Go'. Usually this is where I turn off Gomod and just do without it.

TheDiveO

unread,
Aug 10, 2022, 1:36:07 PM8/10/22
to golang-nuts
Second the painful experience when having to work with company internal code repos. In addition to the git global rewriting rule and GOPRIVATE I use a PAC (personal access token) because that is required in my case. All this is extremely brittle, even more so when building container images, as now the whole env setup needs to be replicated in the multi stage build instructions.
Reply all
Reply to author
Forward
0 new messages