我需要能够从我公司的私有GitLab库中导入围棋模块,但我显然不了解它的工作原理.

在我的go.mod文件的顶部,有问题的模块类似于以下内容:

module gitlab.domain.company.com/path/to/repository

这是我的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

我只使用ssh来推送公司的GitLab,所以我不知道为什么这会成为我的问题,但不管怎样,下面是我的.gitconfig项建议:

[url "ssh:/git@gitlab.domain.company.com/"]
    insteadOf = https://gitlab.domain.company.com/
[url "ssh:/git@gitlab.company.com/"]
    insteadOf = https://gitlab.company.com/

每当我try 对此项目使用go buildgo get时,都会出现以下错误:

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.

一些信息明显被编辑了.

我的围棋版本是在Windows上运行的1.19.我没有办法try 使用这个模块,以至于我正在考虑用一种具有合理版本控制的语言来重写整个应用程序.

推荐答案

我完全忘记了我的ssh配置了密码.现在我已经过了那个阶段,它运行得很顺利.感谢每一位做出贡献的人.我把这个留给将来遇到同样问题的任何人作为建议:如果您有一个用ssh配置的密码,您将不得不解释它.在我的例子中,我可以直接删除它,这可能不是最佳实践,但很有效.

Go相关问答推荐

无法找到与golang、nginx和postquist进行的docker-compose./主要

使用恶意软件 scanner (ClamAV)时的Google云存储桶上传文件验证

ChromeDriver不存在(高朗selenium)

在GO中创建[]字符串类型的变量

在Go中旋转矩阵

这种合并排序的实现有什么问题?

我们如何保证取消的上下文会导致 goroutine 终止?

Golang prometheus:有没有办法衡量出站请求的指标?

Go 中的 YAML 自定义标签

更改多对多连接表的名称

使用 Grafana alert 在几分钟内重复alert

Go:从 ssl 证书中获取 'subject/unstructeredName' 的值

Go cmp - 如何为以 struct 为键的映射定义自定义相等性?

使用 GO 在侧 tar 文件中提取 tar 文件的最快方法

仅在工作日运行 cron

未定义 protoc protoc-gen-go 时间戳

Ginkgo/Gomega panic 测试失败

使用 delve 在容器中调试 Golang:container_linux.go:380:启动容器进程导致:exec:/dlv:stat /dlv:没有这样的文件或目录

Dynamodb.ScanInput - 不能使用expr.Names()(类型 map[string]*string)作为类型 map[string]string

Golang LinkedList 删除第一个元素