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

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.

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

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵