aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/exec.go')
-rw-r--r--src/text/template/exec.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go
index e54a579afd..1c361ed13e 100644
--- a/src/text/template/exec.go
+++ b/src/text/template/exec.go
@@ -79,10 +79,7 @@ func (s *state) at(node parse.Node) {
// doublePercent returns the string with %'s replaced by %%, if necessary,
// so it can be used safely inside a Printf format string.
func doublePercent(str string) string {
- if strings.Contains(str, "%") {
- str = strings.Replace(str, "%", "%%", -1)
- }
- return str
+ return strings.Replace(str, "%", "%%", -1)
}
// TODO: It would be nice if ExecError was more broken down, but