2018-05-21 15:05
浏览 172


I am trying to import a package in my golang code. But it is showing me this error:

cannot find package "" in any of: /opt/go/src/ (from $GOROOT) /chaincode/input/src/ (from $GOPATH) /opt/gopath/src/ "

Can somebody help me fix this?


图片转代码服务由CSDN问答提供 功能建议

我正在尝试使用golang代码导入软件包。 但这向我显示了此错误:

在以下任何位置都找不到软件包“”: / opt / go / src / github .com / mattbaird / jsonpatch(来自$ GOROOT) /chaincode/input/src/来自$ GOPATH) /opt/gopath/src/“ < / p>



  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanjiaren8188 2018-05-24 10:16

    Recheck your environment variables($GOPATH, $GOROOT).

    The problem you are facing is that, your code is searching for the package in /opt/go/src/, /chaincode/input/src/ and /opt/gopath/src/ directories. But you have installed the package in C:\Users\xyz\go\src\ directory.

    点赞 评论
  • douxun3496 2018-05-21 15:08

    Ensure your $GOPATH environment variable is set up correctly.

    Then double check the packages are installed, if not you need to install the package which you can do with.

    go get

    点赞 评论

相关推荐 更多相似问题