How can I add go dependencies that are auto-generated?
I have a protobuf-repository with a single go-file in its root, which contains the following:
//go:generate ./scripts/generate_go_sources.sh
package protobuf
The mentioned script goes through all .proto
files in a "message/" subfolder, and generates the go-sources.
Afterwards, the repository contains a lot of subpackages like
ptyes/package1/file.go
ptyes/package2/file.go
I do not want to check these files in to version control.
How can I use this repository with go dep?
I'm trying to switch to go dep for dependency-management, but I cannot convince it to download this repository and execute "go generate".
Solving failure: No versions of github.com/company/protobuf met constraints:
master: Could not introduce github.com/company/protobuf@master, as it is not allowed by constraint vendoring from project github.com/company/myProject.
develop: Could not introduce github.com/company/protobuf@develop, as it is not allowed by constraint vendoring from project github.com/company/myProject.
vendoring: Could not introduce github.com/company/protobuf@vendoring due to multiple problematic subpackages:
Subpackage github.com/company/protobuf/ptypes/package1 is missing. (Package is required by (root).)
Subpackage github.com/company/protobuf/ptypes/package2 is missing. Package is required by: (root)
go dep discovers the correct repository (vendoring-branch), but discards it because it cannot find the required sub-packages. They are only here once "go generate" was called in the root package.