简体   繁体   中英

unrecognized import path "gopkg.in/yaml.v2" in go 1.16

I just migrated from Fedora 30 to Fedora 34 and also install the golang 1.16 on this os.

I moved my project from the old os to this new os. But I got the error in module dependency ”gopkg.in/yaml.v2":

   go get: unrecognized import path "gopkg.in/yaml.v2": https fetch: Get 
          "https://gopkg.in/yaml.v2?go-get=1": net/http: TLS handshake timeout

I checked the similar question but none of them provide a solution. Thanks in advance.

From Go's source it will find the CA trust for Fedora here:

"/etc/pki/tls/certs/ca-bundle.crt",                  // Fedora/RHEL 6

On Fedora:34 this belongs to the following RPM:

# rpm -qf /etc/pki/tls/certs/ca-bundle.crt

ca-certificates-2020.2.41-7.fc34.noarch

So ensure the RPM ca-certificates is installed at the latest level (above).

Or try a reinstall:

yum reinstall ca-certificates

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM