Fix cannot find package "Golang.org/x/net/context"

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

In the use of Bleve this full-text search engine, (note: Bleve pronunciation can use Chinese "bravur") there are some errors, some of the dependency package cannot be found, resulting in unable to continue, below do some detailed instructions.

Compile error message

"golang.org/x/net/context"in any of:.../projects/go-projects/src/github.com/blevesearch/bleve/vendor/golang.org/x/net/context (vendor tree)/usr/local/go/src/golang.org/x/net/context (from $GOROOT).../projects/go-projects/src/golang.org/x/net/context (from $GOPATH)

Tentative solution

    • $go get golang.org/x/net/...
    • $go get golang.org/x/net/context
    • The above scenario does not work, cannot be downloaded, and the result shows a timeout timeout

Final Solution

cd srcmkdir golang.orgcd golang.orgxxgit clone git@github.com:golang/net.git1
    • Description, create a directory under the SRC directory, such as:src/golang.org/x/
    • In the X directory, make a clone of the warehouse $git clone git@github.com:golang/net.git --depth 1
    • Try compiling again, this issue is resolved

Reference

    • https://github.com/blevesearch/bleve/issues/624
    • https://github.com/beego/admin/issues/55
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.