dqbjvg2518 2017-09-23 03:10
浏览 705
已采纳

golang错误:运行go get时找不到目录包

I'm trying to solve the example provided in Orielly book Decentrallized Applications.

The go-ipfs package seems to be outdated and the new version is not working fine. so I manually coping the older releases and try to compile go-kerala.

Eventhough some of the folder exists in the path I get error.

For example, /home/rajkumar/go/src/github.com/ipfs/go- ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOPATH) is present after I have manually copied older release file but still go-get command gives error.

 $go get -d github.com/llSourcell/kerala
 package code.google.com/p/go.net/context: unrecognized import path 
 "code.google.com/p/go.net/context" (parse 
 https://code.google.com/p/go.net/context?go-get=1: no go-import meta 
 tags (meta tag github.com/golang/go did not match import path 
 code.google.com/p/go.net/context))
 package github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58: cannot find 
 package "github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58" in any of:
    /usr/local/go/src/github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOROOT)
    /home/rajkumar/go/src/github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOPATH)
 package github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup: cannot find 
 package "github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup" in any of:
    /usr/local/go/src/github.com/ipfs/go-
 ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup (from $GOROOT)
 /home/rajkumar/go/src/github.com/ipfs/go-
   ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup (from $GOPATH)
 package github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore: cannot find 
 package "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" in any of:
    /usr/local/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore (from $GOROOT)
    /home/rajkumar/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore (from $GOPATH)
 package github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync: cannot find package "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" in any of:
    /usr/local/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync (from $GOROOT)
    /home/rajkumar/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync (from $GOPATH)

Is there any step I'm missing to resolve the error.

  • 写回答

1条回答 默认 最新

  • doutao1282 2017-09-23 08:18
    关注

    You've copied outdated code, which won't compile.

    code.google.com/p/go.net/context

    code.google.com has shut down, this is an old import path which can no longer be used. The error tells you what has gone wrong, that path can't be imported as it doesn't exist (try visiting it in a browser).

    You could try to spend a lot of time fixing up the old imports, only to find that the packages have changed anyway and will no longer compile, so I'd recommend starting with the latest version and contacting the authors of github.com/ipfs/go-ipfs on github, or choosing another package to work with.

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

报告相同问题?

悬赏问题

  • ¥60 优博讯DT50高通安卓11系统刷完机自动进去fastboot模式
  • ¥15 minist数字识别
  • ¥15 在安装gym库的pygame时遇到问题,不知道如何解决
  • ¥20 uniapp中的webview 使用的是本地的vue页面,在模拟器上显示无法打开
  • ¥15 网上下载的3DMAX模型,不显示贴图怎么办
  • ¥15 关于#stm32#的问题:寻找一块开发版,作为智能化割草机的控制模块和树莓派主板相连,要求:最低可控制 3 个电机(两个驱动电机,1 个割草电机),其次可以与树莓派主板相连电机照片如下:
  • ¥15 Mac(标签-IDE|关键词-File) idea
  • ¥15 潜在扩散模型的Unet特征提取
  • ¥15 iscsi服务无法访问,如何解决?
  • ¥15 感应式传感器制作的感应式讯响器