Closed drewwells closed 8 years ago
Hi there Drew.
AFAIK goxc does support the vendor folder for the main build tasks (i.e. go build, go test, go install). In some cases I had to add workarounds in goxc itself. But, I believe the outstanding problems are down to the limitations of this initial implementation of vendoring, within go 1.5, (and in go-vet itself).
The problem is that vendoring was implemented in part of go
the tool, rather than baked into go/build
, the package. This issue https://github.com/golang/go/issues/12278 (in go itself) illustrates the problem, and the proposed solution. It also hints at how many tools are currently affected (e.g. goimports, go-vet, oracle, lint, errcheck, ...).
So, hopefully this will still get addressed in time for go1.6. I don't really see how they can make vendoring the default behaviour, without adding this level of support.
In the meantime we could keep adding workarounds, but the workarounds are annoying, slow down builds, and frankly I'd just like to hold off until January to see what comes out of the new version.
In the meantime, if you're using vendoring, please use another tool for the 'vet' stage of the build. If you need help with your config, please let me know.
Having said all that, contributions are welcome. There are existing examples in the code of excluding specific folders (including vendor/
) from some of the build tasks. If you're keen, please take a look.
Thanks
In the meantime we could keep adding workarounds, but the workarounds are annoying, slow down builds, and frankly I'd just like to hold off until January to see what comes out of the new version.
What is the solution for Go 1.7?
goxc does not support the vendoring folder, so a separate packing tool is required to use goxc ie.
godep restore
or manually copying vendor/* to $GOPATH/src.Another minor consequence of vendoring is that some tasks like
goxc -tasks+=go-vet
inspect the vendor directory. Something like this can be used to prevent those problemsgo vet $(go list -f '{{.ImportPath}}' ./... | grep -v /vendor/)
. Are there any plans to add direct support for vendoring to goxc? It is going to be enabled by default in Go 1.6.