Skip to content

Commit

Permalink
Switch from html/template to text/template
Browse files Browse the repository at this point in the history
  • Loading branch information
chuhlomin committed Jan 5, 2022
1 parent 91e1cc9 commit 53b4a11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"bytes"
"errors"
"fmt"
"html/template"
"io/ioutil"
"os"
"reflect"
"strings"
"text/template"

"github.com/caarlos0/env/v6"
"gopkg.in/yaml.v3"
Expand Down
8 changes: 8 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ func TestRenderTemplate(t *testing.T) {
errors.New("template: ./testdata/invalid.txt:1: missing value for if"),
"",
},
{
"./testdata/template.txt",
map[string]interface{}{
"name": "text+text",
},
nil,
"Hello text+text\n",
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 53b4a11

Please sign in to comment.