-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make string variable interpolation deterministic, and single-pass.
Right now we replace string variables one at a time, in an order governed by iteration through a map[string]string. This has two implications: - We may expand variables twice. If one variable expands to another variable, that one may be expanded. And so on. - Whether or not this secondary expansion occurs (and even how it occurs!) can vary from run to run. This commit changes to replace everything at once, using the regexp package. It also adds a test to ensure replacements are stable and non-recursiive.
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 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