some observations and receive feedback on them.
Vendor's packages will be moved into a internal folder. Without the
configuration file in the internal folder root it will be impossible for a
machine to know which packages are local internal and which are external
internal. The content of the configuration file is thus important to always
Adding folder trees and re-writing files cannot be done in an atomic
fashion. Should an error occur, or conflict arise, a tool should be able to
I propose that the configuration file include intents and the vendoring
process be multi-step.
Let's take a single dependency node in the configuration file:
"Intent": "+", // can be "+", "-", or "=".
The above node is created in the first pass of the vendoring process,
updating the configuration file. For this node it gives the intent to copy
the package "context" from the "raft" internal package to the top level
internal package. (A similar intent should be recorded in the internal
configuration file for the raft package, removing the context package.)
If there is a conflict (two Import paths that are the same are both added),
the new configuration file is added with the conflicting intents, but kicks
out to the user with a message. The user chooses the nodes to keep and
nodes to remove and runs the process again.
The second pass of the process copies and removes the files according to
the configuration intents and re-writes files as needed.
The third pass inspects the folders and the intents. If the intent is a "-"
indicating a removal, and the folder is not present, the intent can be
removed. Similarly if the intent is a "+" indicating a addition and the
folder is present, the intent is written as a "=" indicating no action is
Configuration files should not be written in place, but written to a temp
file in the same directory and renamed over the original.
I would personally be fine with the configuration file being either a JSON
or CSV file. I am partial to a CSV file myself as it removes the need for
quoting fields (no commas in most or all paths) and the header row can be
I would love to hear your response to this.
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.