In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to solve the problems related to go package management, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
1. Download the walled package
Export GO111MODULE=on
Export GOPROXY= https://goproxy.io
Easily solve problems such as the following: go get golang.org/x/sys: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1) 443: iMago timeout)
There are some repo we do not want to use as agents, such as the company's internal repo, which needs to be set separately: export GOPRIVATE= "gitlab.xxx.com" GONOPROXY= "gitlab.xxx.com"
Export GOPROXY=direct, turn it off.
two。 Access to private warehouses using ssh protocol
Go env-w GOPRIVATE=gitlab.xxx.com
Question: fatal: could not read Username for 'https://gitlab.xxx.com': terminal prompts disabled
Method: git config-- add-- global url. "git@gitlab.xxx.com:" .Einstein of https://gitlab.xxx.com
Reference: https://erwinvaneyk.nl/private-repositories-with-go-mod/
3 Update go mod
Go get-d gitlab.xxx.com/xxx/containerd@80c0ab87fbe6888064cd243aa6a6be77aa7968bf delete private repo in go.mod, delete private repo in requires, and update it in replace as follows: github.com/containerd/containerd v1.4.0 = > gitlab.xxx.com/xxx/containerd v0.0.0-20201202101137-80c0ab87fbe6
Then refresh: go mod vendor
4 go mod tidy: checksum mismatch problem
Go clean-modcache rm go.sum go mod tidy
5. Vndr
Containerd project, using the following: vndr github.com/containerd/cri 362dc5e4e008912d93876d0d194ab0bf6a469aa2 git@gitlab.xxx.com:eci-depend/cri.git
6. Gosum
Background: https://goproxy.io/zh/docs/GOSUMDB-env.html
Error: go get-d gitlab.xxx.com/yyy/cri@zzz
Go: k8s.io/node-problem-detector@v0.0.0-000101000000-000000000000 requires github.com/euank/go-kmsg-parser@v2.0.1+incompatible: verifying go.mod: github.com/euank/go-kmsg-parser@v2.0.1+incompatible/go.mod: reading https://goproxy.io/sumdb/sum.golang.org/lookup/github.com/euank/go-kmsg-parser@v2.0.1+incompatible: 410 Gone server response: not found: github.com/euank/go- Kmsg-parser@v2.0.1+incompatible: invalid version: + incompatible suffix not allowed: module contains a go.mod file So semantic import versioning is required
Solution: export GOSUMDB=off
The above content is how to solve the problems related to go package management. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.