-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is useful when wanting to round-trip a txtar file by extracting its files into a new directory and then write the same archive again. We can't simply read the directory to write the files to a txtar archive again, as we'll likely just end up with sorted filenames. That is not often what one wants; for example, for Go tests, it's often best to keep go.mod at the top. It's also useful to keep an order that makes sense for the human consuming the file in context. Now, the roundtrip can be done correctly by listing the files and using that list again when writing a txtar file back. Note that no variable expansion happens when listing files, as otherwise it would be impossible to keep the original variables in our round-trip scenario. Change-Id: I384cca7ac4ce4dbfb0d3d0f437687b5a2f6298eb Reviewed-on: https://go-review.googlesource.com/c/exp/+/437635 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Daniel Martí <[email protected]>
- Loading branch information
Showing
2 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters