You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
Maybe this isn't a use case that dep should support but I have on a several occasions vendored the deps of utilities need to run go generate . This allows the build process to install the utility from the vendored directory before running go generate. As such the complete build chain is vendored instead of just the dependencies needed to run go build.
I attempted to do something similar with dep but was unsuccessful. I tired a few things like manually editing manifest files or adding overrides for nonexistant dependencies but nothing I tried worked. I even manaully checked out the code to the vendor dir but then dep removed it later during an ensure operation.
Is there a way to manually add explicit dependencies that are not imported by the source files? If not would you consider adding such a feature?
The text was updated successfully, but these errors were encountered:
hi, excellent question! (especially because i get to say "yes" 😄)
yes! you can do this now. it's just not documented, because of the peculiar path that development was taken (we had a way that we were planning to introduce this, but now #277 has us changing course). but, if you add a required section to your manifest.json, e.g.:
(note that, unlike the dependencies section, this is a list of packages, not projects.)
now, those packages will be included/required in your lock & vendor as though you'd imported them. and, specifically germane to your case, you can name main packages in the required list, without any errors arising from importing a main.
there's still the issue of actually being able to compile something from within vendor, but...well, one thing at a time :)
Maybe this isn't a use case that dep should support but I have on a several occasions vendored the deps of utilities need to run
go generate
. This allows the build process to install the utility from the vendored directory before runninggo generate
. As such the complete build chain is vendored instead of just the dependencies needed to rungo build
.I attempted to do something similar with dep but was unsuccessful. I tired a few things like manually editing manifest files or adding overrides for nonexistant dependencies but nothing I tried worked. I even manaully checked out the code to the vendor dir but then dep removed it later during an ensure operation.
Is there a way to manually add explicit dependencies that are not imported by the source files? If not would you consider adding such a feature?
The text was updated successfully, but these errors were encountered: