MagicalTux / goro

PHP in Go
BSD 3-Clause "New" or "Revised" License
691 stars 33 forks source link

go get unrecognized import path "golang.org/x/text/language" #10

Open sushengbuhuo opened 5 years ago

sushengbuhuo commented 5 years ago
[root@VM_0_14_centos ~]# go get github.com/MagicalTux/goro/sapi/php-cli
package golang.org/x/text/language: unrecognized import path "golang.org/x/text/language" (https fetch: Get https://golang.org/x/text/language?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/hkdf: unrecognized import path "golang.org/x/crypto/hkdf" (https fetch: Get https://golang.org/x/crypto/hkdf?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/md4: unrecognized import path "golang.org/x/crypto/md4" (https fetch: Get https://golang.org/x/crypto/md4?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/pbkdf2: unrecognized import path "golang.org/x/crypto/pbkdf2" (https fetch: Get https://golang.org/x/crypto/pbkdf2?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/ripemd160: unrecognized import path "golang.org/x/crypto/ripemd160" (https fetch: Get https://golang.org/x/crypto/ripemd160?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/sha3: unrecognized import path "golang.org/x/crypto/sha3" (https fetch: Get https://golang.org/x/crypto/sha3?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

[root@VM_0_14_centos ~]# go version
go version go1.9.4 linux/amd64
98P commented 5 years ago

network access failed You can use the following library, update to local and change the name

go get -u github.com/golang/text
mv $GOPATH/src/github.com/golang/text $GOPATH/src/golang.org/x/text

go get -u github.com/golang/crypto
mv $GOPATH/src/github.com/golang/crypto $GOPATH/src/golang.org/x/crypto
MagicalTux commented 5 years ago

It looks like golang.org is blocked in China, but can be accessed through https://golang.google.cn.

https://blog.golang.org/hello-china (which you probably can't read) but there are Chinese forums about Go on https://gocn.vip/ where people might have alternatives for this specific issue. @98P 's solution should work just fine too.

A quick search references some documents too, such as https://github.com/northbright/Notes/blob/master/Golang/china/get-golang-packages-on-golang-org-in-china.md