Golang Facebook的包错误
问题描述:
我想从使用REST API的golang中的Facebook Messenger获取好友列表。为此,我试图导入包github.com/huandu/facebook
。但运行代码时它给了一个错误:Golang Facebook的包错误
package context: unrecognized import path "context" (import path does not begin with hostname)
这里是import语句(如godoc https://godoc.org/github.com/huandu/facebook提到):
import (
"fmt"
"github.com/huandu/facebook"
)
谁能告诉我什么,我做错了什么?
我的$ GOPATH设置为$ HOME /去$ GOROOT设置为/usr/lib/go-1.6,它可以很好地用于其他包。 –
@Amandeepkaur:go1.6已过时。更新你的版本,不要设置GOROOT。 – JimB
同意@JimB,你的'$ GOROOT'看起来很可疑。 [看看这个答案。](https://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot#10847122) –