Skip to content

Commit

Permalink
chore(api)!: Removing deprecated RunTemplates function and Config type (
Browse files Browse the repository at this point in the history
#2095)

Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson authored Jun 6, 2024
1 parent 29bd9ed commit 7887f1b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 221 deletions.
151 changes: 0 additions & 151 deletions config.go

This file was deleted.

48 changes: 0 additions & 48 deletions config_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions gomplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ import (
"github.com/hairyhenderson/gomplate/v4/internal/datafs"
)

// RunTemplates - run all gomplate templates specified by the given configuration
//
// Deprecated: use the Renderer interface instead
func RunTemplates(o *Config) error {
cfg, err := o.toNewConfig()
if err != nil {
return err
}
return Run(context.Background(), cfg)
}

// Run all gomplate templates specified by the given configuration
func Run(ctx context.Context, cfg *config.Config) error {
Metrics = newMetrics()
Expand Down
11 changes: 0 additions & 11 deletions gomplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,6 @@ func TestCustomDelim(t *testing.T) {
assert.Equal(t, "hi", testTemplate(t, g, `[print "hi"]`))
}

func TestRunTemplates(t *testing.T) {
buf := &bytes.Buffer{}
config := &Config{Input: "foo", OutputFiles: []string{"-"}, Out: buf}
err := RunTemplates(config)
require.NoError(t, err)
assert.Equal(t, "foo", buf.String())
assert.Equal(t, 1, Metrics.TemplatesGathered)
assert.Equal(t, 1, Metrics.TemplatesProcessed)
assert.Equal(t, 0, Metrics.Errors)
}

func TestSimpleNamer(t *testing.T) {
n := simpleNamer("out/")
out, err := n(context.Background(), "file")
Expand Down

0 comments on commit 7887f1b

Please sign in to comment.