I need to be able to import Go modules from my company's private Gitlab repository, but there's something I'm very obviously not getting about how it works.
The module in question looks something like this at the top of my go.mod file:
module gitlab.domain.company.com/path/to/repository
Here's my go env:
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\E049839\AppData\Local\go-build
set GOENV=C:\Users\E049839\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\E049839\go\pkg\mod
set GONOPROXY=*.company.com
set GONOSUMDB=*.company.com
set GOOS=windows
set GOPATH=C:\Users\E049839\go
set GOPRIVATE=*.company.com
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.19
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\N\the_program\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\E049839\AppData\Local\Temp\go-build416370598=/tmp/go-build -gno-record-gcc-switches
I use ssh exclusively to push and pull from the company's Gitlab, so I don't know why that would be my issue, but here's my .gitconfig anyway:
[url "ssh:/git@gitlab.domain.company.com/"]
insteadOf = https://gitlab.domain.company.com/
[url "ssh:/git@gitlab.company.com/"]
insteadOf = https://gitlab.company.com/
Any time I try to go build or go get for this project, I'm given this error:
go: gitlab.domain.company.com/path/to/lib: unrecognized import path "gitlab.domain.company.com/path/to/lib": https fetch: Get "https://gitlab.domain.company.com/path/to/lib?go-get=1": dial tcp xx.xx.xxx.xxx:xxx: connectex: No connection could be made because the target machine actively refused it.
Some info redacted obviously.
My version of Go is 1.19 running on Windows. I'm out of ideas trying to fool with this module, to the extent that I'm considering rewriting the entire application in a language with sensible version control.