Go run main.go keeps prompting that the package solution cannot be found

Time:2021-10-25

As follows:

./src/github.com/sirupsen/logrus/terminal_check_notappengine.go:9:2: cannot find package “golang.org/x/crypto/ssh/terminal” in any of

The corresponding package has been downloaded from githup in the corresponding path

https://github.com/golang/crypto

But it still prompts this error

At that time, the project was running in the ~ / go directory, and the imported packages could not call each other

When the project is moved to the ~ / go / SRC directory, it will run normally

The directory of gopath is ~ / go

Supplement: the solution that the package cannot be found during go compilation

1. GitHub downloads the corresponding package and puts it in the gopath directory

GitHub itself is unstable. Understandably, it is found that the gopkg.in/yaml.v2 that bee relies on does not cross the wall and has no response at all, so it resolutely gives up go get,

Directly find the source address on GitHub

git clone https://github.com/go-yaml/yaml.git

Create gopkg.in directory under SRC directory, rename yaml to yaml.v2, and then execute go install

2. Host for domain name mapping

adopt https://site.ip138.com/sum.golang.org/ Find the IP that can be accessed by the domain name and map the domain name on the host

The above is my personal experience. I hope I can give you a reference, and I hope you can support developpaer. If you have any mistakes or don’t consider completely, please don’t hesitate to comment.

Recommended Today

Kudu: introduction and architecture of Apache kudu

Summary:Kudu,Hdfs,Hbase Introduction to kudu Kudu is open source by clouderaStorage engine, low latency can be provided at the same timeRandom reading and writingAnd efficientBatch data analysisAbility, he is a fusionHdfsandHbaseA new component with a new storage component in between. Kudu and HBase HDFS comparison.png Kudu is a big data storage engine, which can be combined […]