在 Windows 11 上运行 go mod tidy 时出现 gitlab 权限问题
php小编草莓发现,在使用Windows 11操作系统时,有些开发人员在运行"go mod tidy"命令时遇到了GitLab权限问题。这个问题可能导致无法正确更新模块依赖关系。为了解决这个问题,我们将在本文中为大家提供一些解决方案和建议,以确保顺利运行"go mod tidy"命令并成功更新模块。
问题内容
我能够很好地执行克隆、推送和其他 git 命令(必须存储在 windows 中的凭据管理器中)。但是当我执行 go mod tidy
时出现问题
下面是我在 windows 机器上执行 go mod tidy
时遇到的错误。看起来无法访问私有存储库。
gitlab.xxxxx.de/cxxxxs-v2/arc-lib/cxxxxs-go-lib/pkg/clients: gitlab.xxxx.de/cxxxxs-v2/arc-lib/[email protected]: verifying module: gitlab.xxxx.de/cxxxxs-v2/arc-lib/[email protected]: reading https://sum.golang.org/lookup/gitlab.xxxxx.de/cxxxxs-v2/arc-lib/[email protected]: 404 not found server response: not found: gitlab.xxxxx.de/cxxxxs-v2/arc-lib/[email protected]: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/387e08be1426cc3d2399d471d4c4b55445c31d6ca639398a03889c4c3282d1d5: exit status 128: fatal: could not read username for 'https://gitlab.xxxxx.de': terminal prompts disabled confirm the import path was entered correctly. if this is a private repository, see https://golang.org/doc/faq#git_https for additional information.登录后复制