Populate src
folder in virtual GOPATH
even if project still uses a vendor
folder
#12
Labels
enhancement
New feature or request
Summary
Currently
vgopath
does not populate thesrc
folder in the virtualGOPATH
directory, if the project contains avendor
folder.It would be nice if the
src
directory is populated even in that case so thatvgopath
can be used from projects that still have not gotten rid of thevendor
dir.Motivation
We use
vgopath
in https://github.com/gardener/gardener for code generation, for example in generate-crds.sh which calls vgopath-setup.sh.This script can be invoked from other go projects which import
gardener/gardener
as a go module. E.g. to generate example crds in https://github.com/gardener/gardener-extension-provider-aws/.If a newer version of
gardener/gardener
is vendored in https://github.com/gardener/gardener-extension-provider-aws/ andgenerate-crds.sh
which usesvgopath
is called, e.g. as part ofmake generate
, the following error would occur:This happens because the
src
folder in the temp directory created for the virtualGOPATH
is empty and thegenerate-crds.sh
script setsGO111MODULE
to off here: https://github.com/gardener/gardener/blob/cdad185a27b39b2f35b8ae4d921273d65ae164ae/hack/generate-crds.sh#L48We have a bunch more similar projects that vendor
gardener/gardener
and usegenerate-crds.sh
for which we might not be able to remove thevendor
folder very soon.The text was updated successfully, but these errors were encountered: