diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-06 23:15:25 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-06 23:15:25 -0700 |
commit | b8cba62643abf849411856bd92c42b59b98779f4 (patch) | |
tree | 518ddc4db0ce065353fd6f499c8eaf2975b65d13 /replacer.go | |
parent | 7cca291d62c910c0544f0c0169a8f0c81627e5d3 (diff) |
Refactor for CertMagic v0.10; prepare for PKI app
This is a breaking change primarily in two areas:
- Storage paths for certificates have changed
- Slight changes to JSON config parameters
Huge improvements in this commit, to be detailed more in
the release notes.
The upcoming PKI app will be powered by Smallstep libraries.
Diffstat (limited to 'replacer.go')
-rw-r--r-- | replacer.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/replacer.go b/replacer.go index 8ed6d24..aad13e2 100644 --- a/replacer.go +++ b/replacer.go @@ -148,11 +148,10 @@ func (r *Replacer) replace(input, empty string, if errOnUnknown { return "", fmt.Errorf("unrecognized placeholder %s%s%s", string(phOpen), key, string(phClose)) - } else if treatUnknownAsEmpty { - if empty != "" { - sb.WriteString(empty) - } - } else { + } else if !treatUnknownAsEmpty { + // if treatUnknownAsEmpty is true, we'll + // handle an empty val later; so only + // continue otherwise lastWriteCursor = i continue } |