dongpo1216 2017-03-23 23:04
浏览 101
已采纳

安装依赖项时,如何解决“ go get./…”问题?

When I type "go get ./..." I get back:

./main.go:191: undefined: sendgrid.NewSendGridClientWithApiKey
./main.go:192: undefined: sendgrid.NewMail
./main.go:222: undefined: sendgrid.NewSendGridClientWithApiKey
./main.go:223: undefined: sendgrid.NewMail

How can I fix this error? Or how can I debug this? It is for an older version of go...version 1.5.2..if that helps. Please let me know if I can provide other information. I really do not know where to start as it works fine locally as is. Thanks in advance.

  • 写回答

1条回答 默认 最新

  • doujia4759 2017-03-24 00:25
    关注

    Sendgrid changed their API somewhat recently *.

    The reason it works locally is almost certainly because you had the old version of the go library in your GOPATH... using go get -v -u ./... (updating the dependencies) locally will probably break it locally too.

    You can fix it either by updating your code to match the new API, or by fixing your dependencies by vendoring the old version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分