Skip to content

Commit

Permalink
chore: pkg imported more than once (#861)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
  • Loading branch information
testwill authored Jul 26, 2023
1 parent 0e9d793 commit e83d5a3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/cmd/template/regular_input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/vmware-tanzu/carvel-ytt/pkg/cmd/template"
cmdtpl "github.com/vmware-tanzu/carvel-ytt/pkg/cmd/template"
"github.com/vmware-tanzu/carvel-ytt/pkg/cmd/ui"
"github.com/vmware-tanzu/carvel-ytt/pkg/files"
Expand All @@ -40,8 +39,8 @@ If you want to include those results, use the --output-files or --dangerous-empt
stderr := bytes.NewBufferString("")
ui := ui.NewCustomWriterTTY(false, stdout, stderr)
opts := cmdtpl.NewOptions()
rfsOpts := template.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}}
rfs := template.NewRegularFilesSource(rfsOpts, ui)
rfsOpts := cmdtpl.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}}
rfs := cmdtpl.NewRegularFilesSource(rfsOpts, ui)

out := opts.RunWithFiles(cmdtpl.Input{Files: filesToProcess}, ui)
require.NoError(t, out.Err)
Expand Down Expand Up @@ -76,8 +75,8 @@ organization=Acme Widgets Inc.`)
stderr := bytes.NewBufferString("")
ui := ui.NewCustomWriterTTY(false, stdout, stderr)
opts := cmdtpl.NewOptions()
rfsOpts := template.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}, OutputFiles: outputDir}
rfs := template.NewRegularFilesSource(rfsOpts, ui)
rfsOpts := cmdtpl.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}, OutputFiles: outputDir}
rfs := cmdtpl.NewRegularFilesSource(rfsOpts, ui)

out := opts.RunWithFiles(cmdtpl.Input{Files: filesToProcess}, ui)
require.NoError(t, out.Err)
Expand Down Expand Up @@ -121,8 +120,8 @@ func Test_FileMark_YAML_Shows_No_Warning(t *testing.T) {
ui := ui.NewCustomWriterTTY(false, stdout, stderr)
opts := cmdtpl.NewOptions()
opts.FileMarksOpts.FileMarks = []string{"yaml.txt:type=yaml-plain"}
rfsOpts := template.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}}
rfs := template.NewRegularFilesSource(rfsOpts, ui)
rfsOpts := cmdtpl.RegularFilesSourceOpts{OutputType: cmdtpl.OutputType{Types: []string{"yaml"}}}
rfs := cmdtpl.NewRegularFilesSource(rfsOpts, ui)

out := opts.RunWithFiles(cmdtpl.Input{Files: filesToProcess}, ui)
require.NoError(t, out.Err)
Expand Down

0 comments on commit e83d5a3

Please sign in to comment.