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

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 有偿求码,CNN+LSTM实现单通道脑电信号EEG的睡眠分期评估
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路