facebook - Golang Facebook 包错误

标签 facebook facebook-graph-api go

我正在尝试使用 REST API 从 golang 中的 Facebook Messenger 获取好友列表。为此,我尝试导入包github.com/huandu/facebook。但是在运行代码时出现错误:

包上下文:无法识别的导入路径“context”(导入路径不以主机名开头)

这是导入语句(如 godoc https://godoc.org/github.com/huandu/facebook 中所述):

import (
    "fmt"
    "github.com/huandu/facebook"
)

谁能告诉我我做错了什么?

最佳答案

确保您的 Go 环境设置正确,尤其是您的 $GOPATH$GOROOT

https://golang.org/doc/code.html#GOPATH

关于facebook - Golang Facebook 包错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46647895/

相关文章:

facebook - 快速解析 facebook 错误 : PFFacebookAuthenticationProvider unrecognized selector sent to instance

javascript - window.onclick 在网站中使用两次

iphone - 在 iphone 中使用 SLComposeViewController 在 facebook 上发帖时如何设置文本不可编辑

php - 使用 Facebook Graph API 创建 "Timeline Photos"相册

go - Golang 中的安全关闭连接

go - 使用 io.WriteString 时可执行文件提前退出

go - 在Golang中,json编码和编码有什么区别

javascript - 在 Facebook 应用程序中插入 Mapbox

php - 如何允许人们将我的 Facebook 应用程序订阅到他们的页面?

facebook - 获取状态项的 html 页面链接