Skip to content

Commit 3675b93

Browse files
committed
Remove unused code
1 parent 4e7b9bb commit 3675b93

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

tests/integration/replace.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111
package tests
1212

1313
import (
14-
"bytes"
15-
"html/template"
1614
"maps"
1715
"strconv"
1816
"strings"
1917

20-
"github.com/stretchr/testify/require"
21-
22-
"github.com/sourcenetwork/defradb/errors"
2318
"github.com/sourcenetwork/defradb/tests/state"
2419
)
2520

@@ -69,31 +64,6 @@ var templateDataGenerators = map[string]func(*state.State, int) map[string]strin
6964
},
7065
}
7166

72-
// replace returns a new string with any templating placholders (see "text/template") with data drawn
73-
// from `state`.
74-
func replace(s *state.State, nodeId int, input string) string {
75-
if !strings.Contains(input, "{{") {
76-
// If the input doesn't contain any templating elements we can return early
77-
return input
78-
}
79-
80-
templateData := map[string]string{}
81-
for _, datasetGenerator := range templateDataGenerators {
82-
// Having to regenerate the full dataset for every node-action is horribly inefficient, but
83-
// it is tolerable for now.
84-
maps.Copy(templateData, datasetGenerator(s, nodeId))
85-
}
86-
87-
tmpl := template.Must(template.New("").Parse(input))
88-
var buf bytes.Buffer
89-
err := tmpl.Execute(&buf, templateData)
90-
if err != nil {
91-
require.Fail(s.T, errors.WithStack(err).Error())
92-
}
93-
94-
return buf.String()
95-
}
96-
9767
func replaceMap(s *state.State, nodeId int, inputSet []string) map[string]string {
9868
templateData := map[string]string{}
9969
for _, datasetGenerator := range templateDataGenerators {

0 commit comments

Comments
 (0)