duanbimo7212 2016-09-28 15:30
浏览 118

供应的Go依赖项无法导入

A tale of two projects:

I wrote go-ios7crypt as a quick way to learn Go packaging. The dependencies are vendored using git submodules, and installation is as easy as go get github.com/mcandre/go-ios7crypt/...

Source: https://github.com/mcandre/go-ios7crypt

However, I tried to repeat this pattern for another project, a DuckDuckGo command line launcher. I'm curious what I've done wrong, as neither go get nor go build work when applying the same git submodule-based vendoring to the dependencies for ddg.

Trace:

> go get github.com/mcandre/mcandre/go/ddg/...

(This silently fails to build the ddg binary.)

> where.exe ddg
INFO: Could not find files for the given pattern(s).

Also, the project fails to build from local sources:

> go build
main.go:4:2: cannot find package "github.com/skratchdot/open-golang/open" in any of:
        C:\tools\go1.7\src\github.com\skratchdot\open-golang\open (from $GOROOT)
        C:\Users\andrew\go\src\github.com\skratchdot\open-golang\open (from $GOPATH)

> echo $env:GOPATH
C:\Users\andrew\go

Source: https://github.com/mcandre/mcandre/tree/master/go/ddg

Could the problem be that ddg is a nested project? For comparison, github.com/mcandre/blah/blah/blah is a collection of Go and non-Go projects, whereas github.com/mcandre/go-ios7crypt is a single Go project.

For what it's worth, I'm using Go 1.7 via gvm 1.0.0, with git 2.8.4, in PowerShell, on Windows 10 Professional x86_64.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条