douyue7408
2018-05-27 07:53
浏览 1.1k
已采纳

扫描github.com/golang/protobuf/proto/testdata时出错:找不到包“。”

When running glide install on my project, I get the following error:

[ERROR] Error scanning github.com/golang/protobuf/proto/testdata: cannot find package "." in:
    /Users/bevernie/.glide/cache/src/https-github.com-golang-protobuf/proto/testdata
[ERROR] Failed to retrieve a list of dependencies: Error resolving imports

When checking protobuf's source code, I can in fact see that there is no such package. I however don't directly use protobuf, so the error must come from one of the dependencies I use.

When running glide tree on my project, there is only one instance of github.com/golang/protobuf/proto/testdata:

|-- github.com/golang/protobuf/proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
|   |-- github.com/golang/protobuf/proto/test_proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto/test_proto)
|   |   |-- (Recursion) github.com/golang/protobuf/proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
|   |-- github.com/golang/protobuf/ptypes/any   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/ptypes/any)
|   |   |-- (Recursion) github.com/golang/protobuf/proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
    github.com/golang/protobuf/proto/testdata   (glide get github.com/golang/protobuf/proto/testdata)
|-- github.com/golang/protobuf/ptypes/any   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/ptypes/any)
|   |-- github.com/golang/protobuf/proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
|   |   |-- github.com/golang/protobuf/proto/test_proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto/test_proto)
|   |   |   |-- (Recursion) github.com/golang/protobuf/proto   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
|   |   |-- (Recursion) github.com/golang/protobuf/ptypes/any   (/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/ptypes/any)

which doesn't really help me pinpoint the source of the problem.

Do you have any suggestions as of how to fix the issues?

My project was compiling just fine until a week or two ago (I use Docker to deploy in production, so the glide install was run every time and never failed before that, and I haven't added any new dependency recently).

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

在我的项目上运行 glide install 时,出现以下错误:

  [错误]扫描github.com/golang/protobuf/proto/testdata时出错:找不到包“”。 在:
 /Users/bevernie/.glide/cache/src/https-github.com-golang-protobuf/proto/testdata
[ERROR]无法检索依赖项列表:解决导入错误
   
 
 

在检查protobuf的源代码时,实际上我可以看到没有这样的软件包。 但是我不直接使用protobuf,因此错误必须来自我使用的依赖项之一。

在项目上运行 glide tree 时,存在 github.com/golang/protobuf/proto/testdata 的仅一个实例:

  |--github.com/golang/protobuf/proto(  /Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)\ N |  |-github.com/golang/protobuf/proto/test_proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto/test_proto)
 |  |  |-(递归)github.com/golang/protobuf/proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
 |  |-github.com/golang/protobuf/ptypes/any(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/ptypes/any)
 |  |  |-(递归)github.com/golang/protobuf/proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
 github.com/golang/protobuf/proto/testdata  (滑行获取github.com/golang/protobuf/proto/testdata)
|-- github.com/golang/protobuf/ptypes/any(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf  / ptypes /任意)\ N |  |-github.com/golang/protobuf/proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
 |  |  |-github.com/golang/protobuf/proto/test_proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto/test_proto)
 |  |  |  |-(递归)github.com/golang/protobuf/proto(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/proto)
 |  |  |-(递归)github.com/golang/protobuf/ptypes/any(/Users/bevernie/Programmation/work/src/github.com/golang/protobuf/ptypes/any)

这并不能真正帮助我找出问题的根源。

您对解决问题有何建议?

我的项目可以编译到一两周前(我使用Docker在生产环境中进行部署,因此 glide install 每次都运行并且从未失败过,并且 我最近没有添加任何新的依赖项)。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题