Home > Article > Backend Development > Teach you how to import golang.org packages
The following column golang tutorial will introduce how to import golang.org packages. I hope it will be helpful to friends in need!
Import the package of golang.org
Golang is Google’s open source programming language. After using it for a long time, you will become aware of this fact. Deep experience
For example, when go get some packages, it fails.
How to solve the problem that the package under domestic golang.org cannot be downloaded to the local GOPATH?
Example: github.com/colinmarc/hdfs This package uses part of the functions of golang.org/x/crypto
Reason: golang.org parses out the IP of Google, "of course Should "Access Denied"
method, find the github mirror package:
Steps: git clone [mirror address]. Then under the first GOPATH Create new folders golang.org and x in sequence (the golang.org folder should be at the same level as the github.com folder). Then copy the downloaded crypto folder.
Finally: The package imported by go get github.com/colinmarc/hdfs can be called normally. Import the corresponding package according to your actual situation. The steps are basically similar. The key is to find the image you want.
The above is the detailed content of Teach you how to import golang.org packages. For more information, please follow other related articles on the PHP Chinese website!