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.

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

报告相同问题?