Skip to content

Commit 471bb86

Browse files
committed
remove redundant encoder
1 parent 93f8b4a commit 471bb86

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

task/expression/custom_resolver.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ func (r *CustomResolver) Resolve(data []byte) ([]byte, error) {
3737
// evaluate the expressions
3838
evaler.Eval(v, r.secrets)
3939

40-
// create an encoder that doesn't escape HTML characters
41-
encoder := json.NewEncoder(&bytes.Buffer{})
42-
encoder.SetEscapeHTML(false)
43-
44-
// encode the map back to []byte using the custom encoder
40+
// encode the map back to []byte using a custom encoder that doesn't escape HTML
4541
buf := &bytes.Buffer{}
46-
encoder = json.NewEncoder(buf)
42+
encoder := json.NewEncoder(buf)
4743
encoder.SetEscapeHTML(false)
4844
err = encoder.Encode(v)
4945
if err != nil {

0 commit comments

Comments
 (0)