https://golang.github.io/dep/docs/Gopkg.toml.html#prune
As document description, prune should allow non-go = false options to prevent files discarded by dep, but I got an error output when use this option with dep ensure.
error while parsing /Users/jiangjinyang/workspace/go/src/test/Gopkg.toml: manifest validation failed: root prune options must be omitted instead of being set to false
So I remove prune section from Gopkg.toml, and run dep ensure again. I found "non-go" files under vendor dir is discarded, this behaviour is not according document description.
# document behaviour
Pruning is disabled by default. It can be enabled by setting them to true at the root level.
I'd like to contribute PR, but the behaviour of prune options is so stranger and not clear.
dep are you using (dep version)?v0.4.1
v0.4.1-114-gc55e7a6d
dep command did you run?dep initnon-go = falsedep ensure, got error outputprune section.echo "test" > vendor/testdep ensure, no error occurred, but vendor/test is discardederror while parsing /Users/jiangjinyang/workspace/go/src/test/Gopkg.toml: manifest validation failed: root prune options must be omitted instead of being set to false
# Gopkg.toml
[prune]
non-go = false
go-tests = true
vendor/test should not been discarded.
non-go option should allow false option, and default options of non-go should e false.
prune options is not allow false options, and behaviour is very different with document description.
Seem new vendor dir not include non-go file, so it looks like "non-go" files are discarded.
https://github.com/golang/dep/blob/master/txn_writer.go#L410
Could you please clarify what files should exist but get pruned anyway? It would be helpful if you can specify the project or provide reproduction steps.
@jjyr ah, i can see how the docs about this might be confusing.
It is NOT the goal of pruning to allow you to toss arbitrary stuff in the vendor directory and have it be preserved. Rather, the purpose of pruning is to decide what subset of files that exist in the upstream source should be removed from vendor.
dep wholly controls the vendor directory. If there are files that dep doesn't know the provenance of, it removes them. That's the design, and we can't provide the strong guarantees we aim to without that.