草庐IT

go - 包的类型不能用作 vendored 包的类型

我正在尝试使用这个GolangYelpAPIpackage.在其某些结构中,它使用guregu'snullpackage中定义的类型.我想声明一个在YelpAPI包中定义的结构,其中一些字段将null.Float作为值(i.e.thisstruct,whichimtryingtouse)。所以在我的程序中,我导入了YelpAPI包和guregu的null包,并尝试声明结构,其中ip.Lat和ip.Lat是float64s。(null.FloatFromdefinition):33locationOptions:=yelp.LocationOptions{34ip.Zip,35&yelp

go - 如何在 travis-ci 上管理构建 golang 项目

我正在开发Golang项目并使用TravisCI。作为依赖工具,使用Godeps。通过gitpush运行测试后,出现如下错误。#command-line-argumentscmd/proj/main_test.go:6:2:cannotfindpackage"command-line-/vendor/github.com/xxxxx/xxxxx/abc"inanyof:/home/travis/.gimme/versions/go1.6.linux.amd64/src/command-line-/vendor/github.com/xxxxx/xxxxx/xxx为什么找不到包?作为构建

Govendor 作为类型错误

出现错误:不能使用*company/model作为类型*vendor/company/model平面vendor结构:vendor/公司/型号文件导入“公司/型号” 最佳答案 你有一个包company/model,它既是vendored(在vendor/下)又在你的全局$GOPATH中,你还有一个你的包所依赖的unvendored包这取决于company/model。因此,您的包裹和未出售的包裹都试图使用company/modal类型,但在不同的地方找到它们。解决方案是出售未出售的软件包。

go - 如何确保 go build 使用 vendor 目录中的所有依赖项

我在vendor/目录中使用了godep和vendored我所有的依赖项。Gobuild也工作正常。但是,我如何确定我的所有依赖项都已出售?有什么命令可以确保这一点吗? 最佳答案 我的CI服务(Travis是我使用的服务)让我知道。因为如果deps不可用,我的测试构建将失败。无论如何,您都应该使用CI服务,然后您就可以免费获得该好处。 关于go-如何确保gobuild使用vendor目录中的所有依赖项,我们在StackOverflow上找到一个类似的问题: h

go - 依赖三角

依赖关系是Go的一个问题,但这是新事物:应用程序A直接依赖库B和C库B直接依赖于库C如果我们在应用程序A的代码中有这样的东西:funcyInstance:=&C.FuncyObject{}B.CleverFunction(funcyInstance)当在库B中时:funcCleverFunction(arg*C.FuncyObject){}它引发了一个错误:cannotusefuncyInstance(type"*A/vendor/github.com/C".FuncyObject)astype"*B/vendor/github.com/C".FuncyObjectinargument

Golang 找不到/使用 vendor 文件夹

有没有人知道为什么我在导入github.com/juju/errors时在$GOPATH和$GOROOT前面得到一个_例如repo结构-$GOPATH/src/github.com/codelingo/lexicon/vendor-$GOPATH/src/github.com/codelingo/lexicon/codelingo/ast/go/src/main.go-$GOPATH/src/github.com/codelingo/lexicon/codelingo/ast/go/src/node/node.gomain.go带行号1packagemain23import(4"enc

bash - 去工具 vert 。 |& grep -v vendor ;真

all:gotool@gobuild-v.clean:rm-fapiserverfind.-name"[._]*.s[a-w][a-z]"|xargs-irm-f{}gotool:gofmt-w.gotoolvet.|&grep-vvendor;truehelp:@echo"make-compilethesourcecode"@echo"makeclean-removebinaryfileandvimswpfiles"@echo"makegotool-rungotool'fmt'and'vet'"@echo"makeca-generatecafiles".PHONY:cleangoto

go - 运行 go mod vendor 更新我的库

我正在尝试销售我的go-modules并使用go1.11.5。但是,当我运行gomodvendor时,似乎首先调用了gomodtidy。这会更新我的go库。不幸的是,我依赖于某个库的旧版本。有什么方法可以代替基于go.sum的vendor吗?非常感谢任何帮助! 最佳答案 我认为我遇到的问题是我的go程序指定了特定库的1.2.3版本,但我的程序的依赖项引入了1.2.4版本,导致我在执行govendor时出现问题。这里环境恶劣!我不知道;)。以后问什么我都会三思。和平! 关于go-运行gom

go - 在库中使用外部依赖

我正在使用wgo对于Golang中的依赖管理(虽然我觉得wgo跟这个关系不大),wgo有这样一个文件夹结构project/.gocfg/gopathsvendor.jsonvendor/src/github.com_or_whatever/我有一个我自己编写的库,它在其中一个导出方法中使用nsq-go类型:funcAddNsqSubscription(topic,channelstring,handlernsq.Handler,config*nsq.Config)error{}这个库叫做messi,我像这样导入nsq-go"messi/vendor/src/github.com/bit

go - 在开发 golang 库时,我们是否应该始终将自己的包放在 vendor/folder 中?

最近看了一篇文章http://glide.readthedocs.io/en/latest/vendor/,有一些建议,其中之一是:Libraries(codebaseswithoutamainpackage)shouldnotstoreoutsidepackagesinavendor/folderintheirVCSunlesstheyhaveaspecificreasonandunderstandwhythey'redoingit.我的问题是:根据这个建议,在开发golang库时,我们是否应该始终将自己的包(而不是那些第三方包)放在vendor/文件夹中?